twig() public method

See also: Bolt\Twig\Handler\HtmlHandler::twig()
public twig ( $snippet, $extravars = [] )
Example #1
0
 public function testTwig()
 {
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $handlers['html'] = $this->getMockHandler('HtmlHandler', 'twig');
     $twig = new TwigExtension($app, $handlers, true);
     $twig->twig(null, null);
 }
Example #2
0
 public function testTwig()
 {
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $twig = new TwigExtension($app, $handlers, false);
     $snippet = 'Hello {{item}}';
     $this->assertEquals('Hello World', $twig->twig($snippet, ['item' => 'World']));
 }