public static function arrayFormat($model, $attribute, $options = [])
    {
        $replacer = function($v){
            return '<pre>'.preg_replace(['#[\s\n]*\)#', '#Array[\s\n]*\(#'], ['', ''], print_r($v, true)).'</pre>';
        };
        return array_merge([
            'attribute' => $attribute,
            'format' => 'raw',
            'value' => !$model->isNewRecord
                ? $replacer($model->$attribute)
                : function ($data) use ($attribute, $replacer) {
                    return $replacer($data->$attribute);
                },
            'visible' => $model->isAttributeSafe($attribute),
        ], $options);
    }
public static function arrayFormat($model, $attribute, $options = [])
    {
        $replacer = function($v){
            return '<pre>'.preg_replace(['#[\s\n]*\)#', '#Array[\s\n]*\(#'], ['', ''], print_r($v, true)).'</pre>';
        };
        return array_merge([
            'attribute' => $attribute,
            'format' => 'raw',
            'value' => !$model->isNewRecord
                ? $replacer($model->$attribute)
                : function ($data) use ($attribute, $replacer) {
                    return $replacer($data->$attribute);
                },
            'visible' => $model->isAttributeSafe($attribute),
        ], $options);
    }
public static function arrayFormat ( $ model , $ attribute , $ options = [ ] ) { $ replacer = function ( $ v ) { return '<pre>' . preg_replace ( [ '#[\s\n]*\)#' , '#Array[\s\n]*\(#' ] , [ '' , '' ] , print_r ( $ v , true ) ) . '</pre>' ; } ; return array_merge ( [ 'attribute' => $ attribute , 'format' => 'raw' , 'value' => ! $ model -> isNewRecord ? $ replacer ( $ model -> $ attribute ) : function ( $ data ) use ( $ attribute , $ replacer ) { return $ replacer ( $ data -> $ attribute ) ; } , 'visible' => $ model -> isAttributeSafe ( $ attribute ) , ] , $ options ) ; }
Renders Grid column for array value
@param ActiveRecord|bool $model
@param $attribute
@param array $options
@return array
Renders Grid column for array value