示例#1
0
 public function render($template, $parameters)
 {
     if (strpos($template, ':') === false) {
         //there is no package name, we should add it
         $template = $this->getPackageName() . ':' . $template;
     }
     return $this->container->getTemplating()->render($template, $parameters);
 }
示例#2
0
 /**
  * @TODO: should have some BlockBuilder? BlockConfigurationBuilder? instead
  *
  * @param Config\BlockConfig $config
  */
 protected function initialize(Config\BlockConfig $config)
 {
     $templating = $this->container->getTemplating();
     if (!$templating instanceof TwigTemplating) {
         throw new \RuntimeException('Twig templating engine is required.');
     }
     $config->initialize($templating->getTwig());
 }