Ejemplo n.º 1
0
 protected function compileGetParent(JsCompiler $compiler, \Twig_NodeInterface $node)
 {
     $compiler->write("/**\n", " * @inheritDoc\n", " */\n")->write($this->functionName . ".prototype.getParent_ = function(context) {\n")->indent()->write('return ');
     if (null === $node->getNode('parent')) {
         $compiler->repr(false);
     } else {
         $compiler->setTemplateName(true)->subcompile($node->getNode('parent'))->setTemplateName(false);
     }
     $compiler->raw(";\n")->outdent()->write("};\n\n");
 }