public function action_index() { $obj = ORM::factory('Shop_Product')->available()->get_by_slug($this->request->param('slug')); if (!$obj->loaded()) { throw new HTTP_Exception_404(); } // TODO: optimize used $categories foreach (Breadcrumb::get_path($obj->category->id, 'Shop_Category') as $item) { $this->breadcrumbs[] = $item; } $this->breadcrumbs[] = ['label' => $obj->title]; $this->title = $obj->meta_t; $this->keywords = $obj->meta_k; $this->description = $obj->meta_d; $this->content = View::factory($this->view, ['obj' => $obj]); }