Q:

Twig doesn't output compiled template, just echoes template filename

I'm in a Wordpress environment, PHP 5.4.1, and Apache. The following is in my functions.php:
require_once( get_template_directory() . '/libs/twig/lib/Twig/Autoloader.php' );
Twig_Autoloader::register();
$loader = new Twig_Loader_String( get_template_directory().'/partials/twig-templates' );
$Twig = new Twig_Environment($loader);

//doesn't work, outputs "test.html" in plain text
echo $Twig->render('test.html', array('name' => 'Cameron')); 

//this does output a compiled template, "hey Cameron"
echo $Twig->render('hey {{name}}', array('name' => 'Cameron'));

I've verified that Twig is loaded properly and the file path to the template is correct.
I'm guessing its something simple that I'm overlooking. Any thoughts? Thanks!

A:

Your loader is Twig_Loader_String which can be used only with string inputs.
For a file to be rendered, use
$loader = new Twig_Loader_Filesystem('/path/to/templates');

http://twig.sensiolabs.org/doc/intro.html

