/** * Loads the template [View] object. */ public function before() { parent::before(); if ($this->auto_render === TRUE) { if ($this->request->is_ajax() === TRUE) { // Load the template $this->template = View::factory('system/ajax'); } else { $this->template = View::factory($this->template); } // Initialize empty values $this->template->title = NULL; $this->template->content = NULL; $this->breadcrumbs = Breadcrumbs::factory(); $routes = Route::all(); if (isset($routes['backend'])) { $this->breadcrumbs->add(UI::icon('home'), Route::get('backend')->uri()); } $this->init_media(); } }
/** * * @param integer $level * @return array */ public function breadcrumbs($level = 0) { $crumbs = Breadcrumbs::factory(); if ($this->parent() instanceof Model_Page_Front and $this->level > $level) { $this->parent()->_recurse_breadcrumbs($level, $crumbs); } $crumbs->add($this->breadcrumb(), $this->url, TRUE, NULL, array('id' => $this->id)); return $crumbs; }