本文整理匯總了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();
}
}
}
示例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();
}
}
}
示例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();
}
}
}
示例4: renderHeaderCellContent
protected function renderHeaderCellContent()
{
if ($this->headerText != null) {
echo $this->headerText;
} else {
parent::renderHeaderCellContent();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
}