/** * Constructor. * * @param Doozr_Registry &$registry The instance of Doozr_Registry * @param string $resource The resource to load * @param array $config The resource to set as input (optional) * defaults come from configuration * * @throws Doozr_Template_Service_Exception * @author Benjamin Carl <*****@*****.**> * @return \Doozr_Template_Service * @access public */ public function __construct(Doozr_Registry &$registry, $resource = null, array $config = null) { // Detect and store settings if ($config) { $path = $config['path']; $library = $config['library']; } else { $path = $registry->getConfiguration()->kernel->view->template->path; $library = $registry->getConfiguration()->kernel->view->template->engine->library; } // Store registry instance self::setRegistry($registry); // Init $this->resource($resource)->path($path)->library($library)->initEngine($library, $path); }