public function create($id = null) { $this->layout = 'content.create'; $this->metas['title'] = "Агуулга нэмэх"; if ($id != null) { $this->metas['title'] = "Агуулга засах"; } $this->appendScriptStyle(); $this->view = $this->BuildLayout(); $this->view->withUser($this->user)->withCategories(Category::getCategoryOptions(2))->withContentTypeOptions(ContentType::getContentTypeOptions()); if ($id != null) { $content = Content::find($id); $this->view->withContent($content); } return $this->view; }