Skip to content

Instantly share code, notes, and snippets.

View wkjagt's full-sized avatar

Willem van der Jagt wkjagt

  • Shopify
  • Oka (Montreal area)
View GitHub Profile
<?php
// setup a template loader used by Twig to load the template strings. Most common is loading
// templates from the file system. This loader needs takes a template path or an array of
// template paths as argument to its constructor.
$templatePath = __DIR__.'/templates';
$loader = new Twig_Loader_Filesystem($templatePath);
// setup the twig environment. This is used for the actual rendering. The Twig environment takes
// the loader and an array of options as its arguments. In this example I use the twig environment