Spoon/Template — Issue #4: Set template path in environment
Author: bauffman
Created: 2012-02-07 13:15:46+00:00
State: open

When working with templates it would be nice if you could set the base/start path of your templates. That would make your code cleaner.

Say I have:
app/views/users/index.tpl
app/views/contact/form.tpl

If you set
$environment = new Environment(
array('path' => 'app/views'
);

When you then want to render your template, the path is cleaner.
$template = new Template($environment);
$template->render('users/index.tpl');