本文整理汇总了PHP中yii\grid\Column::renderFilterCellContent方法的典型用法代码示例。如果您正苦于以下问题:PHP Column::renderFilterCellContent方法的具体用法?PHP Column::renderFilterCellContent怎么用?PHP Column::renderFilterCellContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\grid\Column
的用法示例。
在下文中一共展示了Column::renderFilterCellContent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFilterCellContent
protected function renderFilterCellContent()
{
$filter = $this->guessFilter();
if ($filter instanceof BaseFilter) {
return $filter->render();
}
return Column::renderFilterCellContent();
}
示例2: renderFilterCellContent
/**
* @inheritdoc
*/
protected function renderFilterCellContent()
{
if (is_string($this->filter)) {
return $this->filter;
}
$model = $this->grid->filterModel;
if ($this->filter !== false && $model instanceof Model && $this->attribute !== null && $model->isAttributeActive($this->attribute)) {
if ($model->hasErrors($this->attribute)) {
Html::addCssClass($this->filterOptions, 'has-error');
$error = ' ' . Html::error($model, $this->attribute, $this->grid->filterErrorOptions);
} else {
$error = '';
}
if (is_array($this->filter)) {
$options = array_merge(['prompt' => ''], $this->filterInputOptions);
return Html::activeDropDownList($model, $this->attribute, $this->filter, $options) . $error;
} else {
return Html::activeTextInput($model, $this->attribute, $this->filterInputOptions) . $error;
}
} else {
return parent::renderFilterCellContent();
}
}
示例3: renderFilterCellContent
/**
* @inheritdoc
*/
protected function renderFilterCellContent()
{
if (is_string($this->filter)) {
return $this->filter;
} elseif ($this->filter !== false && $this->grid->filterModel instanceof Model && $this->attribute !== null && $this->grid->filterModel->isAttributeActive($this->attribute)) {
if (is_array($this->filter)) {
$options = array_merge(['prompt' => ''], $this->filterInputOptions);
return Html::activeDropDownList($this->grid->filterModel, $this->attribute, $this->filter, $options);
} else {
return Html::activeTextInput($this->grid->filterModel, $this->attribute, $this->filterInputOptions);
}
} else {
return parent::renderFilterCellContent();
}
}