Skip to content

Instantly share code, notes, and snippets.

@siygle
Created June 10, 2011 06:43
Show Gist options
  • Save siygle/1018338 to your computer and use it in GitHub Desktop.
Save siygle/1018338 to your computer and use it in GitHub Desktop.
<?php
require_once 'Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem('templates');
$config = array(
'cache' => 'cache',
);
$twig = new Twig_Environment($loader, $config);
$template = $twig->loadTemplate('index.html.twig');
$data = array('name'=>'Ferrari', 'project'=>'Twig');
echo $template->render($data);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment