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