本文整理汇总了PHP中yii\grid\DataColumn::getDataCellValue方法的典型用法代码示例。如果您正苦于以下问题:PHP DataColumn::getDataCellValue方法的具体用法?PHP DataColumn::getDataCellValue怎么用?PHP DataColumn::getDataCellValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\grid\DataColumn
的用法示例。
在下文中一共展示了DataColumn::getDataCellValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDataCellValue
/**
* @inheritdoc
*/
public function getDataCellValue($model, $key, $index)
{
if ($this->value !== null) {
return parent::getDataCellValue($model, $key, $index);
} else {
$class = $this->menuClass;
return $class::create(['model' => $model])->render(MenuButton::class);
}
}
示例2: getDataCellValue
/**
* @inheritdoc
*/
public function getDataCellValue($model, $key, $index)
{
if ($this->value !== null) {
return parent::getDataCellValue($model, $key, $index);
}
$attributeSet = $this->attribute !== null;
$mappingSet = is_array($this->valueMapping);
$vKey = ArrayHelper::getValue($model, $this->attribute);
if ($attributeSet && $mappingSet && isset($this->valueMapping[$vKey])) {
return $this->valueMapping[$vKey];
}
return parent::getDataCellValue($model, $key, $index);
}
示例3: getDataCellValue
/**
* @inheritdoc
* @param mixed $model
* @param mixed $key
* @param int $index
* @return null|string
* @throws InvalidConfigException
*/
public function getDataCellValue($model, $key, $index)
{
if (count($this->editable) == 2) {
if (is_string($this->editable[0]) && $this->editable[0] == 'editor') {
$editorConfig = call_user_func($this->editable[1], $model, $key, $index, $this);
$this->initEditableColumns($model, $editorConfig);
if ($this->value !== null) {
if (is_string($this->value)) {
return Html::a(ArrayHelper::getValue($model, $this->value), '', $editorConfig);
} else {
return Html::a(call_user_func($this->value, $model, $key, $index, $this), '', $editorConfig);
}
} elseif ($this->attribute !== null) {
return Html::a(ArrayHelper::getValue($model, $this->attribute), '', $editorConfig);
}
} else {
throw new InvalidConfigException('配置错误');
}
return null;
} else {
return parent::getDataCellValue($model, $key, $index);
}
}
示例4: getDataCellValue
/**
* @param mixed $model
* @param mixed $key
* @param int $index
* @return mixed
*/
public function getDataCellValue($model, $key, $index)
{
$value = parent::getDataCellValue($model, $key, $index);
return ArrayHelper::getValue($this->enum, $value, $value);
}
示例5: getDataCellValue
/**
* @inheritdoc
*/
public function getDataCellValue($model, $key, $index)
{
$value = parent::getDataCellValue($model, $key, $index);
if ($this->trueValue !== true) {
if ($value == $this->falseValue) {
return $this->falseIcon;
} else {
return $this->trueIcon;
}
} else {
if ($value !== null) {
return $value ? $this->trueIcon : $this->falseIcon;
}
return $this->showNullAsFalse ? $this->falseIcon : $value;
}
}
示例6: getDataCellValue
public function getDataCellValue($model, $key, $index)
{
$value = parent::getDataCellValue($model, $key, $index);
$this->_total += $value;
return $value;
}