protected function replaceSubparts($templateCode)
    {
        $template = $this;
        return preg_replace_callback(
            self::SUBPART_PATTERN,
            function (array $matches) use ($template) {
                return $template->getSubpart($matches[1]);
            },
            $templateCode
        );
    }
protected function replaceSubparts($templateCode)
    {
        $template = $this;
        return preg_replace_callback(
            self::SUBPART_PATTERN,
            function (array $matches) use ($template) {
                return $template->getSubpart($matches[1]);
            },
            $templateCode
        );
    }
protected function replaceSubparts ( $ templateCode ) { $ template = $ this ; return preg_replace_callback ( self :: SUBPART_PATTERN , function ( array $ matches ) use ( $ template ) { return $ template -> getSubpart ( $ matches [ 1 ] ) ; } , $ templateCode ) ; }
Recursively replaces subparts with their contents.

@param string $templateCode the template, may be empty

@return string the template with the subparts replaced
Recursively replaces subparts with their contents .