public function portfolio_itemAction($seo = null)
 {
     if (!$seo) {
         return Brightery::error404();
     }
     $portfolio_item = new \modules\portfolio\models\Portfolio();
     $portfolio_item->seo = $seo;
     print_r($portfolio_item->get());
     return $this->render('portfolio_item', ['item' => $portfolio_item->get()]);
 }
 public function manageAction($id = false)
 {
     $this->permission('manage');
     if ($id) {
         $model = new \modules\portfolio\models\Portfolio('edit');
     } else {
         $model = new \modules\portfolio\models\Portfolio('add');
     }
     $model->attributes = $this->Input->post();
     $model->language_id = $this->language->getDefaultLanguage();
     if (!$id) {
         $model->created = date("Y-m-d H:i:s");
     }
     if ($id) {
         $model->portfolio_id = $id;
     }
     $blog_category = Form_helper::queryToDropdown('portfolio_categories', 'portfolio_category_id', 'title');
     if ($model->save()) {
         Uri_helper::redirect("management/portfolio_items");
     }
     return $this->render('portfolio_items/manage', ['item' => $id ? $model->get() : null, 'blog_category' => $blog_category]);
 }