/** * 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); }
public function testPrefillDefault() { $template = new Template(__DIR__ . '/resources/views/'); $template->layout('layouts/default'); $this->assertEquals('default', $template->prefill('foo', 'default'), 'Should return the passed default for unset template variable.'); }