Example #1
0
 /**
  * Set up the template system
  *
  * @param string $directory Filesystem path to the views directory.
  */
 public function initializeTemplate($directory = null)
 {
     if (empty($directory)) {
         $directory = $this->config->resolvePath('views');
     }
     // Remember what directory was set. We may have to reinitialize the template later and don't want to lose the previous setting.
     $this->views_directory = $directory;
     $this->template = new Template($directory, $this->config);
     // Add our url builder to the template.
     $extension = new \werx\Url\Extensions\Plates(null, null, $this->expose_script_name);
     $this->template->loadExtension($extension);
 }