当前位置: 首页>>代码示例>>PHP>>正文


PHP GridView::classname方法代码示例

本文整理汇总了PHP中kartik\grid\GridView::classname方法的典型用法代码示例。如果您正苦于以下问题:PHP GridView::classname方法的具体用法?PHP GridView::classname怎么用?PHP GridView::classname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kartik\grid\GridView的用法示例。


在下文中一共展示了GridView::classname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bootstrap

 /** @inheritdoc */
 public function bootstrap($app)
 {
     $configManager = Yii::$app->configManager;
     $configManager->register('userGrid', GridView::classname(), ['persistResize' => true, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true, 'loadingCssClass' => false, 'options' => ['scrollTo' => 0]], 'striped' => true, 'condensed' => false, 'bordered' => false, 'layout' => '
             <div class="box-body">
                 {items}
             </div>
             <div class="box-footer clearfix">
                 <div class="pull-right">
                     {pager}
                 </div>
                 <div class="pull-left summary-wrapper">
                     {summary}
                 </div>
             </div>']);
     $configManager->register('userGridNameColumn', GridView::classname(), ['attribute' => 'username', 'format' => 'raw', 'hAlign' => GridView::ALIGN_LEFT, 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model) {
         return Html::a(isset($model->profile) ? $model->profile->name . ' (' . $model->username . ')' : $model->username, ['/management/user/update', 'id' => $model->id], ['data-pjax' => 0, 'data-toggle' => 'tooltip', 'data-placement' => 'right', 'data-html' => 'true', 'data-trigger' => 'hover click', 'title' => '<i class="glyphicon glyphicon-edit"> </i>' . '&nbsp;&nbsp;' . Yii::t('app', 'Edit')]);
     }]);
     $configManager->register('userGridBlockColumn', GridView::classname(), ['header' => 'Block status', 'format' => 'raw', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model) {
         if ($model->is(User::BLOCKED)) {
             return Html::a('<i class="fa fa-unlock"></i>' . '&nbsp;&nbsp;' . 'Unblock', ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-success btn-block btn-flat', 'data-method' => 'post']);
         } else {
             return Html::a('<i class="fa fa-lock"></i>' . '&nbsp;&nbsp;' . 'Block', ['block', 'id' => $model->id], ['class' => 'btn btn-xs btn-danger btn-block btn-flat', 'data-method' => 'post']);
         }
     }]);
     $configManager->register('userGridRoleColumn', GridView::classname(), ['header' => 'Role', 'format' => 'raw', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model) {
         return !empty(Yii::$app->authHelper->getRoleNameByUserId($model->id)) ? Html::tag('span', Yii::$app->authHelper->getRoleNameByUserId($model->id), ['class' => "label bg-default label-default"]) : null;
     }]);
 }
开发者ID:asiborro,项目名称:yii2-management,代码行数:30,代码来源:Bootstrap.php

示例2: init

 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     $dp = static::slash(BaseDataProvider::className());
     if (empty($this->dataProvider) || !$this->dataProvider instanceof BaseDataProvider) {
         throw new InvalidConfigException("The 'dataProvider' property must be set and must be an instance of '{$dp}'.");
     }
     $kvGrid = static::slash(GridView::classname());
     if (empty($this->gridClass)) {
         $this->gridClass = $kvGrid;
     } elseif ($this->gridClass !== $kvGrid && !is_subclass_of($this->gridClass, $kvGrid)) {
         throw new InvalidConfigException("The 'gridClass' must be a class which extends from '{$kvGrid}'.");
     }
     $this->initOptions();
     $this->registerAssets();
 }
开发者ID:kartik-v,项目名称:yii2-builder,代码行数:20,代码来源:TabularForm.php


注:本文中的kartik\grid\GridView::classname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。