コード例 #1
0
 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());
 }
コード例 #2
0
 /**
  * Sets caption text.
  *
  * @param string $text
  */
 public function setText($text)
 {
     $this->text->setData($text);
 }
コード例 #3
0
ファイル: Controller.php プロジェクト: view-components/grids
 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();
     }
 }