public function actionCreate()
{
$model = new Tweet();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
$topService = new TweetService();
if (!$topService->filterContent($model->content)) {
$this->flash('请勿发表无意义的内容', 'warning');
return $this->redirect('index');
}
$model->user_id = Yii::$app->user->id;
$model->type = $model::TYPE;
if ($model->save()) {
$this->flash('发表成功!', 'success');
}
}
return $this->redirect('index');
}