Example #1
0
 public function actionCreateentry()
 {
     $name = Yii::$app->request->post('name');
     $body = Yii::$app->request->post('body');
     $category = Yii::$app->request->post('category');
     Yii::$app->response->format = Response::FORMAT_JSON;
     $entry = new Entry();
     $entry->name = $name;
     $entry->body = Markdown::convert($body);
     $entry->category = $category;
     $entry->save();
     $tag = EntryTag::setTags($entry->id, Yii::$app->request->post('tags'));
     return $tag;
 }