Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function whyAreYouDoingThis (string $tmplName, array $params) {
- static $twig = null;
- if ($twig === null) {
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
- $twig = new Twig_Environment($loader, array(
- 'cache' => '/path/to/compilation_cache',
- ));
- }
- echo $twig->render($tmplName, $params);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement