示例#1
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     $class = $this->model;
     $class = Yii::$app->base->crc32($class::className());
     $models = Comment::getTree($this->model->id, $class);
     $model = new Comment(['scenario' => 'create']);
     $model->model_class = $class;
     $model->model_id = $this->model->id;
     return $this->render('index', ['models' => $models, 'model' => $model]);
 }
示例#2
0
 /**
  * @param Comment $model Comment
  *
  * @return string Comments list
  */
 protected function tree($model)
 {
     $models = Comment::getTree($model->model_id, $model->model_class);
     return $this->renderPartial('@vova07/comments/widgets/views/_index_item', ['models' => $models]);
 }