comments!="Y") return ""; $query = $model->getCommentsAll()->orderBy(['created_at'=>SORT_ASC])->andWhere(['visible'=>'Y']); ?>

Комментарии count()?>

all(); $items = []; $islike = Comments::getUserLike($model->id); if( is_array($islike) ){ $islike = array_flip($islike); }else{ $islike = array(); } foreach( $rows as $item ){ $citem = []; $citem['id'] = $item->id; if( isset($items[$item->parent_id]) ){ $citem['parent_id'] = $item->parent_id; }else{ // потеряный предок перенести в корень но можно и убить $citem['parent_id'] = 0; } $citem['children'] = 0; $item->islike = isset($islike[$item->id]); $citem['item'] = $item; $items[$item->id] = $citem; } // yii\helpers\VarDumper::dump($items,2);; $otree = new Tree(); $tree = $otree->buildTree($items); $otree->drawTree($tree, $this); /* foreach( $rows as $item ){ echo $this->render('_item', [ 'model' => $item, ]); } */ /* \yii\widgets\ListView::widget([ "dataProvider" => new \yii\data\ActiveDataProvider([ "query"=>$query, "pagination" =>[ "pageSize"=>0 ], ]), 'options' => [ 'tag' => "ul", 'class' => 'list-wrapper', 'id' => 'list-wrapper', ], "itemOptions"=>[ "tag"=>"li" ], "itemView" => function ($model, $key, $index, $widget) { return $this->render('_item', [ 'model' => $model, 'key' => $key, 'index' => $index, 'widget' => $widget, ]);}, "layout" => "{items}" ]);*/ ?>
isActive() ){ ?>
" maxlength="30">