Created
February 27, 2016 11:00
-
-
Save ruliarmando/29357288a0c8984a7b1f to your computer and use it in GitHub Desktop.
Twig template cache example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* index.html */ | |
class __TwigTemplate_37a968442c22648ceb4a16069820cc5350b97e50f45f26c5442d7c036ad743d2 extends Twig_Template | |
{ | |
public function __construct(Twig_Environment $env) | |
{ | |
parent::__construct($env); | |
$this->parent = $this->env->loadTemplate("base.html"); | |
$this->blocks = array( | |
'title' => array($this, 'block_title'), | |
'content' => array($this, 'block_content'), | |
); | |
} | |
protected function doGetParent(array $context) | |
{ | |
return "base.html"; | |
} | |
protected function doDisplay(array $context, array $blocks = array()) | |
{ | |
$this->parent->display($context, array_merge($this->blocks, $blocks)); | |
} | |
// line 3 | |
public function block_title($context, array $blocks = array()) | |
{ | |
echo " "; | |
echo twig_escape_filter($this->env, (isset($context["pageTitle"]) ? $context["pageTitle"] : null), "html", null, true); | |
echo " "; | |
} | |
// line 5 | |
public function block_content($context, array $blocks = array()) | |
{ | |
// line 6 | |
echo " <div class=\"hero-unit\"> | |
<h1>Twig CRUD</h1> | |
<p> | |
Aplikasi ini bertujuan untuk menunjukkan cara penggunaan template engine Twig dengan native PHP. | |
</p> | |
</div> | |
<hr> | |
"; | |
} | |
public function getTemplateName() | |
{ | |
return "index.html"; | |
} | |
public function isTraitable() | |
{ | |
return false; | |
} | |
public function getDebugInfo() | |
{ | |
return array ( 40 => 6, 37 => 5, 29 => 3,); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment