protected function resolveSubTemplateDependencies($function)
    {
        if ($this->debug) {
            echo 'Compiler::' . __FUNCTION__ . "\n";
        }

        $body = $this->templatePlugins[$function]['body'];
        foreach ($this->templatePlugins as $func => $attr) {
            if ($func !== $function && !isset($attr['called']) && strpos($body, Core::NAMESPACE_PLUGINS_FUNCTIONS .
            'Plugin' . Core::toCamelCase($func)) !== false) {
                $this->templatePlugins[$func]['called'] = true;
                $this->resolveSubTemplateDependencies($func);
            }
        }
        $this->templatePlugins[$function]['checked'] = true;
    }
protected function resolveSubTemplateDependencies($function)
    {
        if ($this->debug) {
            echo 'Compiler::' . __FUNCTION__ . "\n";
        }

        $body = $this->templatePlugins[$function]['body'];
        foreach ($this->templatePlugins as $func => $attr) {
            if ($func !== $function && !isset($attr['called']) && strpos($body, Core::NAMESPACE_PLUGINS_FUNCTIONS .
            'Plugin' . Core::toCamelCase($func)) !== false) {
                $this->templatePlugins[$func]['called'] = true;
                $this->resolveSubTemplateDependencies($func);
            }
        }
        $this->templatePlugins[$function]['checked'] = true;
    }
protected function resolveSubTemplateDependencies ( $ function ) { if ( $ this -> debug ) { echo 'Compiler::' . __FUNCTION__ . "\n" ; } $ body = $ this -> templatePlugins [ $ function ] [ 'body' ] ; foreach ( $ this -> templatePlugins as $ func => $ attr ) { if ( $ func !== $ function && ! isset ( $ attr [ 'called' ] ) && strpos ( $ body , Core :: NAMESPACE_PLUGINS_FUNCTIONS . 'Plugin' . Core :: toCamelCase ( $ func ) ) !== false ) { $ this -> templatePlugins [ $ func ] [ 'called' ] = true ; $ this -> resolveSubTemplateDependencies ( $ func ) ; } } $ this -> templatePlugins [ $ function ] [ 'checked' ] = true ; }
Checks what sub-templates are used in every sub-template so that we're sure they are all compiled.

@param string $function the sub-template name
Checks what sub - templates are used in every sub - template so that we re sure they are all compiled .