本文整理汇总了PHP中CGridColumn::getHeaderCellContent方法的典型用法代码示例。如果您正苦于以下问题:PHP CGridColumn::getHeaderCellContent方法的具体用法?PHP CGridColumn::getHeaderCellContent怎么用?PHP CGridColumn::getHeaderCellContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGridColumn
的用法示例。
在下文中一共展示了CGridColumn::getHeaderCellContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHeaderCellContent
/**
* Returns the header cell content.
* This method will render a link that can trigger the sorting if the column is sortable.
* @return string the header cell content.
* @since 1.1.16
*/
public function getHeaderCellContent()
{
if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
return $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) {
return CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
} else {
return CHtml::encode($this->name);
}
} else {
return parent::getHeaderCellContent();
}
}
示例2: getHeaderCellContent
/**
* Returns the header cell content.
* This method will render a checkbox in the header when {@link selectableRows} is greater than 1
* or in case {@link selectableRows} is null when {@link CGridView::selectableRows} is greater than 1.
* @return string the header cell content.
* @since 1.1.16
*/
public function getHeaderCellContent()
{
if (trim($this->headerTemplate) === '') {
return $this->grid->blankDisplay;
}
if ($this->selectableRows === null && $this->grid->selectableRows > 1) {
$item = CHtml::checkBox($this->id . '_all', false, array('class' => 'select-on-check-all'));
} elseif ($this->selectableRows > 1) {
$item = CHtml::checkBox($this->id . '_all', false);
} else {
$item = parent::getHeaderCellContent();
}
return strtr($this->headerTemplate, array('{item}' => $item));
}