Example #1
0
 /**
  * Lists all Posts models.
  * @return mixed
  */
 public function actionIndex()
 {
     $model = new Posts();
     $arr = ['post_title' => 'Learning CodeIgniter', 'post_description' => 'CodeIgniter is framework php easy for new development', 'author_id' => 1];
     $model->insert('posts', $arr);
     echo 'successful';
     die;
     $searchModel = new PostsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }