コード例 #1
0
ファイル: HtmlView.php プロジェクト: im286er/windwalker
 /**
  * Method to instantiate the view.
  *
  * @param   array             $data     The data array.
  * @param   RendererInterface $renderer The renderer engine.
  */
 public function __construct($data = array(), RendererInterface $renderer = null)
 {
     $this->renderer = $renderer ?: new PhpRenderer();
     parent::__construct($data);
     $this->data = new Data($this->data);
 }
コード例 #2
0
 /**
  * Method to test render().
  *
  * @return void
  *
  * @covers Windwalker\View\HtmlView::render
  */
 public function testRender()
 {
     $this->assertEquals('<h1>Sakura</h1>', trim($this->instance->render()));
     $this->instance->set('flower', 'Olive');
     $this->assertEquals('<h1>Olive</h1>', trim($this->instance->render()));
 }