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


PHP DataColumn::renderHeaderCellContent方法代码示例

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


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

示例1: renderHeaderCellContent

 public function renderHeaderCellContent()
 {
     if ($this->header !== null || $this->label === null && $this->attribute === null) {
         return parent::renderHeaderCellContent();
     }
     $provider = $this->grid->dataProvider;
     if ($this->label === null) {
         if ($provider instanceof ActiveDataProvider && $provider->query instanceof ActiveQueryInterface) {
             /* @var $model Model */
             $model = new $provider->query->modelClass();
             $label = $model->getAttributeLabel($this->attribute);
         } else {
             $models = $provider->getModels();
             if (($model = reset($models)) instanceof Model) {
                 /* @var $model Model */
                 $label = $model->getAttributeLabel($this->attribute);
             } else {
                 $label = Inflector::camel2words($this->attribute);
             }
         }
     } else {
         $label = $this->label;
     }
     return $this->encodeLabel ? Html::encode($label) : $label;
 }
开发者ID:itzj86,项目名称:yii2-dwz,代码行数:25,代码来源:DataColumn.php

示例2: renderHeaderCellContent

 protected function renderHeaderCellContent()
 {
     $parentHeader = parent::renderHeaderCellContent();
     $sort = $this->grid->dataProvider->getSort();
     $direction = $sort->getAttributeOrder($this->attribute);
     if ($direction === null) {
         return $parentHeader;
     }
     $class = $direction == SORT_ASC ? 'asc' : 'desc';
     return $parentHeader . Html::tag('span', '', ['class' => [$class]]);
 }
开发者ID:tsyrya,项目名称:mybriop,代码行数:11,代码来源:DataColumn.php

示例3: renderFooterCellContent

 /**
  * Used to render footer like header
  */
 protected function renderFooterCellContent()
 {
     return parent::renderHeaderCellContent();
 }
开发者ID:baranov-nt,项目名称:setyes,代码行数:7,代码来源:DataColumn.php

示例4: renderHeaderCellContent

 /**
  * @inheritdoc
  */
 protected function renderHeaderCellContent()
 {
     if ($this->header !== null || $this->label === null && $this->attribute === null) {
         return parent::renderHeaderCellContent();
     }
     $provider = $this->grid->dataProvider;
     if ($this->label === null) {
         $label =& $this->label;
         if ($provider instanceof ActiveDataProvider && $provider->query instanceof ActiveQueryInterface) {
             /* @var $model Model */
             $model = new $provider->query->modelClass();
             $label = $model->getAttributeLabel($this->attribute);
         } else {
             $models = $provider->getModels();
             if (($model = reset($models)) instanceof Model) {
                 /* @var $model Model */
                 $label = $model->getAttributeLabel($this->attribute);
             } else {
                 $label = Inflector::camel2words($this->attribute);
             }
         }
     } else {
         $label = $this->label;
     }
     if ($this->attribute !== null && $this->enableSorting && ($sort = $provider->getSort()) !== false && $sort->hasAttribute($this->attribute)) {
         return $sort->link($this->attribute, array_merge($this->sortLinkOptions, ['label' => $this->encodeLabel ? Html::encode($label) : $label]));
     } else {
         return $this->encodeLabel ? Html::encode($label) : $label;
     }
 }
开发者ID:xuguoliangjj,项目名称:yiiblog,代码行数:33,代码来源:EditorDataColumn.php


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