/** * Lists all commentary models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => commentary::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }
<h1><?php echo Html::encode($this->title); ?> </h1> <h4><?php echo "author: {$model->author_id} Date: {$model->publish_date}"; ?> </br></h4> <?php echo DetailView::widget(['model' => $model, 'template' => "{value}", 'attributes' => ['content:ntext']]); ?> </div> <div style="width:60%"> </br> <?php echo Html::a('New Commentary', ['com/create', 'idpost' => $model->id], ['class' => 'btn btn-primary']); ?> <h3>Commentary:</h3> <?php $dataProvider = new ActiveDataProvider(['query' => commentary::find()->where(['postid' => $model->id]), 'pagination' => ['pageSize' => conf::$numbercomperpage], 'sort' => ['defaultOrder' => ['data' => SORT_DESK]]]); echo ListView::widget(['dataProvider' => $dataProvider, 'itemView' => '_com']); ?> </br> </div> </div> </center>