public function test()
 {
     $text = new DataView('some text');
     self::assertEquals('some text', $text->render());
     self::assertEquals('some text', $text->getData());
     $res = $text->setData('some text 2');
     self::assertEquals($text, $res);
     self::assertEquals('some text 2', $text->render());
 }
Exemple #2
0
 protected function demo14Details()
 {
     $provider = $this->getDataProvider();
     $provider->operations()->add(new FilterOperation('id', FilterOperation::OPERATOR_EQ, $_GET['id']));
     foreach ($provider as $item) {
         $view = new TemplateView('data_view/table', get_object_vars($item));
         BootstrapStyling::applyTo($view);
         $layout = new DataView(function () use($view) {
             $out = $view->render();
             return "<div class='panel panel-default'>\n                <div class='panel-body'>{$out}</div>\n            </div>";
         });
         return $layout->render();
     }
 }