本文整理汇总了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();
}
}
}