/** * @param $id */ public function actionView($id) { $this->article = $this->articlesRepository->get($id); $this->getTemplate()->article = $this->article; $this->getTemplate()->title = $this->article->title() > '' ? $this->article->title() : $this->article->name(); $this->getTemplate()->description = $this->article->description() > '' ? $this->article->description() : $this->article->text(); $this->getTemplate()->keywords = $this->article->keywords() > '' ? $this->article->keywords() : ''; }
/** * @param $form */ public function formSubmitted(Form $form) { $values = $form->getValues(); if ($values->theme > '') { $values->idTheme = $this->articlesRepository->newTheme($values->theme); } $this->article = $this->articlesRepository->get($values->id); $this->article->name($values->name); $this->article->text($values->text); $this->article->pictureName($values->pictureName); $this->article->pictureDescription($values->pictureDescription); $this->article->active($values->active); $this->article->title($values->title); $this->article->description($values->description); $this->article->keywords($values->keywords); $this->article->galleryIds(json_encode($values->galleryIds)); $this->article->idTheme($values->idTheme); $this->getUrl($values); }