當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。