frontend\modules\tweet\controllers\DefaultController::actionIndex PHP Method

actionIndex() public method

public actionIndex ( )
    public function actionIndex()
    {
        $searchModel = new TweetSearch();
        $params = Yii::$app->request->queryParams;
        $params['TweetSearch']['content'] = empty($params['topic']) ? '' : $params['topic'];
        $dataProvider = $searchModel->search($params);
        $dataProvider->query->andWhere([Post::tableName() . '.type' => Tweet::TYPE, 'status' => [Post::STATUS_ACTIVE, Post::STATUS_EXCELLENT]]);
        $model = new Tweet();
        return $this->render('index', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
    }