Esempio n. 1
0
 /**
  * @test
  */
 public function shouldCreateRendererAsSetInConfigurationForParticularViewEvenThoughDefaultRendererIsSpecified()
 {
     //given
     Config::overrideProperty('renderer', 'default')->with('DefaultRenderer');
     Config::overrideProperty('renderer', 'my_view')->with('DummyRenderer');
     //when
     $renderer = ViewRendererFactory::create('my_view', array());
     //then
     $this->assertInstanceOf('DummyRenderer', $renderer);
 }
Esempio n. 2
0
 public function render($viewName = '')
 {
     if (!empty($viewName)) {
         $this->_viewName = $viewName;
     }
     if (!$this->_renderer) {
         $this->_renderer = ViewRendererFactory::create($this->_viewName, $this->_attributes);
     }
     $this->verifyExists($this->_renderer->getViewPath(), $this->_viewName);
     $this->_renderedView = $this->_renderer->render();
     return $this->_renderedView;
 }