コード例 #1
0
ファイル: DataTableSnippet.php プロジェクト: jivoo/jivoo
 /**
  * {@inheritdoc}
  */
 public function before()
 {
     parent::before();
     if (isset($this->request->cookies['data-table-per-page'])) {
         $this->object->rowsPerPage = intval($this->request->cookies['data-table-per-page']);
     }
     if (isset($this->request->cookies['data-table-density'])) {
         $this->object->density = $this->request->cookies['data-table-density'];
     } else {
         $this->object->density = 'medium';
     }
     $tableSettings = new Form('tableSettings');
     $tableSettings->addField('perPage', DataType::integer(DataType::UNSIGNED));
     $tableSettings->__set('perPage', $this->object->rowsPerPage);
     $tableSettings->addField('density', DataType::enum(array('low', 'medium', 'high')));
     $tableSettings->__set('density', $this->object->density);
     $this->viewData['tableSettings'] = $tableSettings;
 }
コード例 #2
0
ファイル: PartialJtkSnippet.php プロジェクト: jivoo/jivoo
 /**
  * Invoke the snippet using the settings object.
  * @return Jivoo\Routing\Response|string Response object or string.
  */
 public function __invoke()
 {
     return $this->snippet->__invoke(array($this->object));
 }