Beispiel #1
0
 public function testPHPViewWithFullPath()
 {
     Views::addLocation(new FilesystemLocation(__DIR__ . '/fixtures', ['.php']));
     $view = Views::create(__DIR__ . '/fixtures/php-view.php');
     $this->assertInstanceOf('BrightNucleus\\View\\View\\BaseView', $view);
     $html = $view->render(['title' => 'Dynamic Title']);
     $this->assertEquals(file_get_contents(__DIR__ . '/fixtures/php-view-result.html'), $html);
 }
Beispiel #2
0
 /**
  * Initialize the view builder associated with the view.
  *
  * @since 0.2.0
  */
 protected function initializeViewBuilder()
 {
     if (null === $this->builder) {
         $this->builder = Views::getViewBuilder();
     }
 }