$engines
$engines : array<mixed,string>
A factory used to retrieve a template engine given a simplified name.
With this factory it is possible to abstract away the actual class names and provide a faux name that is suitable for configuration purposes. An additional benefit is that any plugin is able to register their own template engines if desired.
__construct(array<mixed,\phpDocumentor\Plugin\Scrybe\Template\TemplateInterface> $engines = array())
Registers the default and provided Template engines.
array<mixed,\phpDocumentor\Plugin\Scrybe\Template\TemplateInterface> | $engines | Associative array of the engine class names and their name as key. |
register(string $name, \phpDocumentor\Plugin\Scrybe\Template\TemplateInterface $templateEngine) : void
Associates a human-readable / simplified name with a class name representing a template engine.
The class belonging to the given class name should implement the TemplateInterface. If it does not then
this method won't complain (as no instantiation is done here for performance reasons) but the get()
method
will throw an exception.
string | $name | |
\phpDocumentor\Plugin\Scrybe\Template\TemplateInterface | $templateEngine |
get(string $name) : \phpDocumentor\Plugin\Scrybe\Template\TemplateInterface
Returns a new instance of the template engine belonging to the given name.
string | $name |
if the given name is not registered