当前位置: 首页>>代码示例>>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;未经允许,请勿转载。