本文整理匯總了PHP中Breadcrumbs::factory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Breadcrumbs::factory方法的具體用法?PHP Breadcrumbs::factory怎麽用?PHP Breadcrumbs::factory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Breadcrumbs
的用法示例。
在下文中一共展示了Breadcrumbs::factory方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: before
/**
* 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();
}
}
示例2: breadcrumbs
/**
*
* @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;
}