_templater = new $templateClass($templates); if (isset($this->settings['templates'])) { $this->_templater->load($this->settings['templates']); } } /** * Get/set templates to use. * * @param string|null|array $templates null or string allow reading templates. An array * allows templates to be added. * @return void|string|array */ public function templates($templates = null) { if ($templates === null || is_string($templates)) { return $this->_templater->get($templates); } return $this->_templater->add($templates); } /** * Format a template string with $data * * @param string $name The template name. * @param array $data The data to insert. * @return string */ public function formatTemplate($name, $data) { return $this->_templater->format($name, $data); } /** * Returns the template engine object * * @return StringTemplate */ public function getTemplater() { return $this->_templater; } }