XaminProject/handlebars.php — pull request #102 by jeffturcotte (2014-12-16 02:38:32+00:00)
Title: Added custom template class option and optional name passed to template

This enhancement is fully backwards compatible and is meant to replicate some of the extensibility that is available in Twig.

My specific use case involves custom loaders/template classes that read yaml front-matter which can alter the context. I was able to achieve this in Twig through the use of a loader and their 'base_template_class' option and wanted to achieve similar functionality with this lib, so I added a 'template_class' option. The Template object now also receives it's name (when applicable) as that is important to retrieve any metadata that may be associated with it.

The new option ensures the class is a subclass of Handlebars\Template so current type hints continue to work throughout library code and custom helpers that developers may have written. Let me know if you have any comments/questions.

Usage:
```php
new FilesystemLoader('/path'),
'template_class' => 'CustomTemplate'
]);
```