Created
May 10, 2012 01:09
-
-
Save mgng/2650227 to your computer and use it in GitHub Desktop.
Twig sample
This file contains 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
私の名前は{{name}}です。 |
This file contains 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
compilation_cache | |
├─0b | |
│ └fc | |
│ └bd58afe05991c85d5c257bd2e549.php | |
└─39 | |
└47 | |
└76d77f721495e2e98fe30ddae1bb.php |
This file contains 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 | |
require_once '/path/to/lib/Twig/Autoloader.php'; | |
Twig_Autoloader::register(); | |
$loader = new Twig_Loader_Filesystem( '/path/to/view/template' ); | |
$twig = new Twig_Environment( $loader, array( | |
'cache' => '/path/to/view/compilation_cache', | |
'charset' => 'utf-8', | |
'auto_reload' => true, | |
// 'autoescape' => false, | |
)); | |
echo $twig->render( 'index.html', array( 'name' => 'mgng' ) ); |
This file contains 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 | |
require_once '/path/to/lib/Twig/Autoloader.php'; | |
Twig_Autoloader::register(); | |
$loader = new Twig_Loader_Filesystem( '/path/to/view/template' ); | |
$twig = new Twig_Environment( $loader, array( | |
// 'cache' => '/path/to/view/compilation_cache', | |
'cache' => false, | |
'charset' => 'utf-8', | |
'auto_reload' => true, | |
// 'autoescape' => false, | |
)); | |
echo $twig->render( 'index.html', array( 'name' => 'mgng' ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment