Skip to content

Instantly share code, notes, and snippets.

@augustohp
Created February 14, 2012 01:08
Show Gist options
  • Save augustohp/1822233 to your computer and use it in GitHub Desktop.
Save augustohp/1822233 to your computer and use it in GitHub Desktop.
Respect\Config example: Twig configuration and instantiation
view_path = '/app/views'
[options]
debug = false
charset = 'UTF-8'
base_template_class = 'Twig_Template'
strict_variables = false
autoescape = true
cache = false
auto_reload = null
optimizations = -1
; ------------------------------------------------------------
; Respect\Config things, there is no need to change below this
[loader Twig_Loader_Filesystem]
paths = [view_path]
[twig Twig_Environment]
loader = [loader]
options = [options]
@augustohp
Copy link
Author

Usage is like this:

$container = new Respect\Config\Container('Twig.ini');
$twig      = $container->twig;

// Example taken from Twig documentation
echo $twig->render('index.html', array('name' => 'Fabien'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment