require_once '/path/to/vendor/autoload.php'; $loader = new Twig_Loader_Array(array( 'index' => 'Hello !', )); $twig = new Twig_Environment($loader); echo $twig->render('index', array('name' => 'Fabien'));