當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GridView::init方法代碼示例

本文整理匯總了PHP中yii\grid\GridView::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP GridView::init方法的具體用法?PHP GridView::init怎麽用?PHP GridView::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\grid\GridView的用法示例。


在下文中一共展示了GridView::init方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 /**
  * Inits widget
  */
 public function init()
 {
     parent::init();
     $this->initVisible();
     $this->initSortable();
     //GridViewAsset::register($this->view);
 }
開發者ID:diginova,項目名稱:yii2-metronic,代碼行數:10,代碼來源:GridView.php

示例2: init

 public function init()
 {
     parent::init();
     if (!$this->options['ajax']) {
         echo '<div id="box-' . $this->id . '" class="box box-primary">' . '  <div class="box-header with-border">';
         if (isset($this->options['boxTitle'])) {
             echo Html::tag('h3', '<i class="fa fa-list"></i> ' . $this->options['boxTitle'], ['class' => 'box-title']);
         }
         echo '<div class="box-tools pull-right">';
         if (isset($this->options['buttonUp'])) {
             echo Html::a('<i class="fa fa-arrow-up"></i>', $this->options['buttonUp'], ['id' => 'button-up', 'class' => 'btn btn-sm btn-default', 'title' => \Yii::t('theme/widgets/box', 'Up')]);
             echo ' ';
         }
         if (isset($this->options['buttonCreate'])) {
             echo Html::a('<i class="fa fa-plus"></i>', $this->options['buttonCreate'], ['class' => 'btn btn-sm btn-primary', 'title' => \Yii::t('theme/widgets/box', 'Create')]);
             echo ' ';
         }
         if (isset($this->options['buttonDelete'])) {
             echo Html::a('<i class="fa fa-trash-o"></i>', $this->options['buttonDelete'], ['id' => 'batch-delete', 'class' => 'btn btn-sm btn-danger', 'title' => \Yii::t('theme/widgets/box', 'Delete')]);
             echo ' ';
         }
         if (isset($this->options['buttonUndo'])) {
             echo Html::a('<i class="fa fa-undo"></i>', $this->options['buttonUndo'], ['class' => 'btn btn-sm btn-default', 'title' => \Yii::t('theme/widgets/box', 'Undo')]);
             echo ' ';
         }
         echo '</div>';
         echo '</div>';
         echo '<div class="box-body">';
         $this->renderFiltersForm();
     }
     echo "<div id='table-{$this->id}'>";
 }
開發者ID:andreosoft,項目名稱:andreocms,代碼行數:32,代碼來源:GridView.php

示例3: init

 public function init()
 {
     parent::init();
     $this->emptyText = Html::t('templete', 'noData');
     $this->summary = Html::t('templete', 'summary');
     $this->getView()->registerCssFile('/css/listStyle.css');
 }
開發者ID:fufudao,項目名稱:yii2-base,代碼行數:7,代碼來源:GridView.php

示例4: init

 public function init()
 {
     parent::init();
     if ($this->ajaxPager) {
         $this->pager['targetId'] = $this->id;
     }
 }
開發者ID:vsguts,項目名稱:crm,代碼行數:7,代碼來源:GridView.php

示例5: init

 public function init()
 {
     $this->tableOptions = ['class' => 'table ' . $this->type];
     $this->dataProvider = new ArrayDataProvider(['allModels' => $this->data, 'pagination' => false]);
     $this->layout = '{items}';
     parent::init();
 }
開發者ID:AlvaCorp,項目名稱:yii2-adminlte-demo,代碼行數:7,代碼來源:Table.php

示例6: init

 public function init()
 {
     $this->showHeader = false;
     $this->showFooter = false;
     $this->layout = '{items}';
     $this->columns = [['class' => 'yii\\grid\\DataColumn', 'format' => 'raw', 'value' => function ($post) {
         foreach ($post->postDates as $postDate) {
             if (!isset($first)) {
                 $first = $postDate->PostDate;
             }
             $last = $postDate->PostDate;
         }
         if ($first == $last) {
             $value = $first;
         } else {
             $value = $first . ' &mdash; ' . $last;
         }
         if ($post->PostText) {
             $value = $value . '<br />' . $post->PostText;
         }
         return $value;
     }], ['format' => 'raw', 'value' => function ($post) {
         return '<span class="js-past_vacation_delete grid_delete_icon" data-post-id="' . $post->PostID . '"><i class="fa fa-trash"></i></span>';
     }]];
     parent::init();
 }
開發者ID:vladimirgolovanov,項目名稱:purrfect-awesome-friends-feed-decorator,代碼行數:26,代碼來源:PastDatesGrid.php

示例7: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (empty($this->columns)) {
         $this->columns = $this->columns();
     }
     $this->columns = array_merge($this->columns, $this->actions());
     parent::init();
 }
開發者ID:dawei101,項目名稱:yii2-admin-module,代碼行數:11,代碼來源:Grid.php

示例8: init

 public function init()
 {
     if ($this->sortableColumn) {
         array_unshift($this->columns, ['class' => 'twixoff\\sortablegrid\\SortableColumn']);
     }
     $this->sortableAction = Url::to($this->sortableAction);
     parent::init();
 }
開發者ID:twixoff,項目名稱:yii2-sortable-grid-view-widget,代碼行數:8,代碼來源:SortableGridView.php

示例9: init

 /**
  * Initializes the grid view.
  * This method will initialize required property values and instantiate [[columns]] objects.
  */
 public function init()
 {
     $this->dataColumnClass = DataColumn::className();
     $this->summaryOptions = ['class' => 'summary well well-sm pull-left margin-bottom-10px'];
     $this->layout = '{summary}<div class="clearfix"></div>{pager}{items}{pager}';
     $this->showFooter = true;
     $this->options = ArrayHelper::merge($this->options, ['class' => 'grid-view table-responsive']);
     $this->pager = ['class' => LinkPager::className()];
     parent::init();
 }
開發者ID:uran1980,項目名稱:yii2-translate-panel,代碼行數:14,代碼來源:GridView.php

示例10: init

 public function init()
 {
     parent::init();
     $this->tableOptions['layoutH'] = $this->layoutH;
     $this->layout = "<div id='w_list_print'>{summary}\n{items}\n{pager}</div>";
     $this->options['class'] = 'pageContent';
     $pagination = new Pagination();
     $this->dataProvider->setPagination($pagination);
     $this->dataProvider->setSort(new Sort());
 }
開發者ID:itzj86,項目名稱:yii2-dwz,代碼行數:10,代碼來源:GridView.php

示例11: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (empty($this->columns)) {
         $this->columns = $this->columns();
     }
     if (!isset($this->columns['actions'])) {
         $this->columns['actions'] = ['class' => 'asdfstudio\\admin\\grids\\ActionColumn'];
     }
     parent::init();
 }
開發者ID:asdf-studio,項目名稱:yii2-admin-module,代碼行數:13,代碼來源:Grid.php

示例12: init

 public function init()
 {
     if ($this->modelClass === null) {
         $models = $this->dataProvider->getModels();
         if (($model = reset($models)) instanceof Model) {
             $this->modelClass = $model->classname();
         }
     }
     parent::init();
 }
開發者ID:sangkilsoft,項目名稱:sangkilbiz-3,代碼行數:10,代碼來源:Grid.php

示例13: init

 public function init()
 {
     parent::init();
     $this->rowOptions = function ($model, $key, $index, $grid) {
         if ($index % 2 === 0) {
             return ['class' => 'odd'];
         } else {
             return ['class' => 'even'];
         }
     };
 }
開發者ID:hucongyang,項目名稱:lulucms2,代碼行數:11,代碼來源:GridView.php

示例14: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if ($this->actions) {
         $column = ['class' => 'app\\base\\grid\\ActionColumn', 'header' => 'Actions'];
         if (is_array($this->actions)) {
             $column['buttons'] = $this->actions;
         }
         $this->columns[] = $column;
     }
     parent::init();
     $this->initDefaultToolButtons();
 }
開發者ID:skoro,項目名稱:yii2-admin-template,代碼行數:15,代碼來源:GridView.php

示例15: init

 public function init()
 {
     parent::init();
     if (!isset($this->sortUrl)) {
         throw new InvalidConfigException("You must specify the sortUrl");
     }
     GridViewAsset::register($this->view);
     SortableGridViewAsset::register($this->view);
     $this->tableOptions['class'] .= ' sortable-grid-view';
     $this->rowOptions = function ($model, $key, $index, $grid) {
         return ['id' => "items[]_{$model->primaryKey}"];
     };
 }
開發者ID:richardfan1126,項目名稱:yii2-sortable-gridview,代碼行數:13,代碼來源:SortableGridView.php


注:本文中的yii\grid\GridView::init方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。