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


PHP CDataColumn::renderHeaderCellContent方法代码示例

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


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

示例1: renderHeaderCellContent

 /**
  *### .renderHeaderCellContent()
  *
  * Renders the header cell content.
  * This method will render a link that can trigger the sorting if the column is sortable.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         $sort = $this->grid->dataProvider->getSort();
         $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
         if ($sort->resolveAttribute($this->name) !== false) {
             if ($sort->getDirection($this->name) === CSort::SORT_ASC) {
                 $label .= ' <span class="icon-sort-down"></span>';
             } elseif ($sort->getDirection($this->name) === CSort::SORT_DESC) {
                 $label .= ' <span class="icon-sort-up"></span>';
             } else {
                 $label .= ' ';
             }
         }
         echo $sort->link($this->name, $label, array('class' => 'sort-link'));
     } else {
         if ($this->name !== null && $this->header === null) {
             if ($this->grid->dataProvider instanceof CActiveDataProvider) {
                 echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
             } else {
                 echo CHtml::encode($this->name);
             }
         } else {
             parent::renderHeaderCellContent();
         }
     }
 }
开发者ID:CrystReal,项目名称:Site_backend,代码行数:33,代码来源:TbDataColumn.php

示例2: renderHeaderCellContent

 /**
  *### .renderHeaderCellContent()
  *
  * Renders the header cell content.
  * This method will render a link that can trigger the sorting if the column is sortable.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         $sort = $this->grid->dataProvider->getSort();
         $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
         $booster = Booster::getBooster();
         if ($sort->resolveAttribute($this->name) !== false) {
             $label .= ' <span class="caret"></span>';
         }
         /* {
         			if($sort->getDirection($this->name) === CSort::SORT_ASC){
                       		$label .= ' <span class="'.($booster->fontAwesomeCss ? 'fa fa-sort-asc' : 'icon-chevron-down').'"></span>';
                        } elseif($sort->getDirection($this->name) === CSort::SORT_DESC){
                        	$label .= ' <span class="'.($booster->fontAwesomeCss ? 'fa fa-sort-desc' : 'icon-chevron-up').'"></span>';
                        } else {
                        	$label .= ' ';
                        }
                    } */
         echo $sort->link($this->name, $label, array('class' => 'sort-link'));
     } else {
         if ($this->name !== null && $this->header === null) {
             if ($this->grid->dataProvider instanceof CActiveDataProvider) {
                 echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
             } else {
                 echo CHtml::encode($this->name);
             }
         } else {
             parent::renderHeaderCellContent();
         }
     }
 }
开发者ID:Aldanzein,项目名称:bursa-kerja,代码行数:37,代码来源:TbDataColumn.php

示例3: renderHeaderCellContent

 /**
  * Renders the header cell content.
  * This method will render a link that can trigger the sorting if the column is sortable.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         $sort = $this->grid->dataProvider->getSort();
         $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
         if (isset($sort->directions[$this->name])) {
             if ($sort->directions[$this->name]) {
                 $label .= ' <span class="dropup"><span class="caret"></span></span>';
             } else {
                 $label .= ' <span class="caret"></span>';
             }
         }
         echo $sort->link($this->name, $label, array('class' => 'sort-link'));
     } else {
         if ($this->name !== null && $this->header === null) {
             if ($this->grid->dataProvider instanceof CActiveDataProvider) {
                 echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
             } else {
                 echo CHtml::encode($this->name);
             }
         } else {
             parent::renderHeaderCellContent();
         }
     }
 }
开发者ID:Aprende-php,项目名称:workshop,代码行数:29,代码来源:BsDataColumn.php

示例4: renderHeaderCellContent

 protected function renderHeaderCellContent()
 {
     if ($this->headerText != null) {
         echo $this->headerText;
     } else {
         parent::renderHeaderCellContent();
     }
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:8,代码来源:SortableColumn.php

示例5: renderHeaderCellContent

 /**
  * Renders the header cell content.
  * This method will render a link that can trigger the sorting if the column is sortable.
  */
 protected function renderHeaderCellContent()
 {
     if ($this->name !== null && $this->header === null) {
         if ($this->grid->dataProvider instanceof CActiveDataProvider) {
             echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
         } else {
             echo CHtml::encode($this->name);
         }
     } else {
         parent::renderHeaderCellContent();
     }
 }
开发者ID:wpp8909,项目名称:findzhibo,代码行数:16,代码来源:TbDataColumn.php

示例6: renderHeaderCellContent

 protected function renderHeaderCellContent()
 {
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         echo $this->grid->dataProvider->getSort()->link($this->name, $this->header, array('class' => 'sort-link'));
     } elseif ($this->name !== null && $this->header === null) {
         if ($this->grid->dataProvider instanceof CActiveDataProvider) {
             echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
         } else {
             echo CHtml::encode($this->name);
         }
     } else {
         parent::renderHeaderCellContent();
     }
 }
开发者ID:ArseniyDyupin,项目名称:SimpleCRM2,代码行数:14,代码来源:MyCDataColumn.php

示例7: renderHeaderCellContent

 /**
  * Require this overwrite to show bootstrap sort icons
  */
 protected function renderHeaderCellContent()
 {
     if (yii::app()->editable->form != EditableConfig::FORM_BOOTSTRAP) {
         parent::renderHeaderCellContent();
         return;
     }
     if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
         $sort = $this->grid->dataProvider->getSort();
         $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
         if ($sort->resolveAttribute($this->name) !== false) {
             $label .= '<span class="caret"></span>';
         }
         echo $sort->link($this->name, $label, array('class' => 'sort-link'));
     } else {
         if ($this->name !== null && $this->header === null) {
             if ($this->grid->dataProvider instanceof CActiveDataProvider) {
                 echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
             } else {
                 echo CHtml::encode($this->name);
             }
         } else {
             parent::renderHeaderCellContent();
         }
     }
 }
开发者ID:branJakJak,项目名称:goawtodayaldiskon,代码行数:28,代码来源:WhEditableColumn.php


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