How do i use twig for templating in my php files?
Posted: Thu Dec 29, 2016 3:01 pm
I just want to beable to use simple twig syntex in my PHP files and so i have the following code i used composer to install twig and added the following lines of code to my index.php file:
Now when i do the following in my index.php file:
I get the following error:
How do i use twig for templating in my php files ??
Code: Select all
require 'vendor/autoload.php';
$loader = new Twig_Loader_Filesystem('twig_templating');
$twig = new Twig_Environment($loader);
Code: Select all
{{ 'yes' }}
Code: Select all
Parse error: syntax error, unexpected '}' in C:\xampp\htdocs\twig_templating\index.php on line 9