Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Like this if you work with NestedSets
/**
* @property integer $id
* @property string $name
* @property string $slug
* @property string $title
* @property string $description
* @property integer $lft
* @property integer $rgt
* @property integer $depth
* @property Meta $meta
*
[
'attribute' => 'name',
'value' => function (Category $model) {
$indent = ($model->depth > 1 ? str_repeat(' ', $model->depth - 1) . ' ' : '');
return $indent . Html::a(Html::encode($model->name), ['view', 'id' => $model->id]);
},
'format' => 'raw',
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question