Merge a specification of absolute view paths
public mergeViewsSpec ( array $spec ) | ||
$spec | array | Specification viewtype => [ view_name => path or array of paths ] |
public function testCanSetViewPathsViaSpec() { $this->views->mergeViewsSpec(['default' => ['hello.js' => __DIR__ . '/../test_files/views/default/js/static.js', 'hello/world.js' => 'engine/tests/phpunit/test_files/views/default/js/interpreted.js.php']]); $expected = file_get_contents("{$this->viewsDir}/default/js/static.js"); $this->assertEquals($expected, $this->views->renderView('hello.js')); $this->assertEquals("// PHPin", $this->views->renderView('hello/world.js', array('in' => 'in'))); }