kartik\grid\ColumnTrait::parseVal PHP Méthode

parseVal() protected méthode

Parses a value if Closure and returns the right value
protected parseVal ( string | integer | Closur\Closure $var, Model $model, string | object $key, integer $index ) : mixed
$var string | integer | Closur\Closure the variable to parse
$model yii\base\Model the model instance
$key string | object the current model key value
$index integer the index of the current record in the data provider
Résultat mixed
    protected function parseVal($var, $model, $key, $index)
    {
        return $var instanceof Closure ? call_user_func($var, $model, $key, $index, $this) : $var;
    }