private function fig_include(Context $context) {

        $file = $this->includedFile;

        $realFilename = dirname($context->getFilename()).'/'.$file;
        //Create a sub-view, attached to the current element.
        $view = new View();

        if ($context->view->getCachePath() && $context->view->getTemplatesRoot()) {
            $view->setCachePath($context->view->getCachePath(), $context->view->getTemplatesRoot());
        }
        $view->loadFile($realFilename);


        //Parse the subview (build its own tree).
        $context->pushInclude($realFilename, $view->figNamespace);

        $view->parse();

        // If the included template specifies a doctype, use it globally for our context.
        if ($view->getRootNode() instanceof ViewElementTag) {
            $doctype = $view->getRootNode()->getAttribute($context->figNamespace . 'doctype');
            if ($doctype) {
                $context->setDoctype($doctype);
            }
        }


        $result = $view->getRootNode()->render($context);

        $context->popInclude();
        return $result;
    }
private function fig_include(Context $context) {

        $file = $this->includedFile;

        $realFilename = dirname($context->getFilename()).'/'.$file;
        //Create a sub-view, attached to the current element.
        $view = new View();

        if ($context->view->getCachePath() && $context->view->getTemplatesRoot()) {
            $view->setCachePath($context->view->getCachePath(), $context->view->getTemplatesRoot());
        }
        $view->loadFile($realFilename);


        //Parse the subview (build its own tree).
        $context->pushInclude($realFilename, $view->figNamespace);

        $view->parse();

        // If the included template specifies a doctype, use it globally for our context.
        if ($view->getRootNode() instanceof ViewElementTag) {
            $doctype = $view->getRootNode()->getAttribute($context->figNamespace . 'doctype');
            if ($doctype) {
                $context->setDoctype($doctype);
            }
        }


        $result = $view->getRootNode()->render($context);

        $context->popInclude();
        return $result;
    }
private function fig_include ( Context $ context ) { $ file = $ this -> includedFile ; $ realFilename = dirname ( $ context -> getFilename ( ) ) . '/' . $ file ; //Create a sub-view, attached to the current element. $ view = new View ( ) ; if ( $ context -> view -> getCachePath ( ) && $ context -> view -> getTemplatesRoot ( ) ) { $ view -> setCachePath ( $ context -> view -> getCachePath ( ) , $ context -> view -> getTemplatesRoot ( ) ) ; } $ view -> loadFile ( $ realFilename ) ; //Parse the subview (build its own tree). $ context -> pushInclude ( $ realFilename , $ view -> figNamespace ) ; $ view -> parse ( ) ; // If the included template specifies a doctype, use it globally for our context. if ( $ view -> getRootNode ( ) instanceof ViewElementTag ) { $ doctype = $ view -> getRootNode ( ) -> getAttribute ( $ context -> figNamespace . 'doctype' ) ; if ( $ doctype ) { $ context -> setDoctype ( $ doctype ) ; } } $ result = $ view -> getRootNode ( ) -> render ( $ context ) ; $ context -> popInclude ( ) ; return $ result ; }
Creates a sub-view object, invokes its parsing phase,
and renders it as the child of the current tag.

@param Context $context

@return string or false
@throws RequiredAttributeException
@throws \figdice\exceptions\FileNotFoundException
@throws \figdice\exceptions\RenderingException
@throws \figdice\exceptions\XMLParsingException
Creates a sub - view object invokes its parsing phase and renders it as the child of the current tag .