本文整理匯總了PHP中Breadcrumbs::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Breadcrumbs::get方法的具體用法?PHP Breadcrumbs::get怎麽用?PHP Breadcrumbs::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Breadcrumbs
的用法示例。
在下文中一共展示了Breadcrumbs::get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: test_should_clear_all_breadcrumbs
/**
* @test
* @group breadcrumbs
*/
public function test_should_clear_all_breadcrumbs()
{
Breadcrumbs::add(Breadcrumb::factory()->set_title("Crumb 1")->set_url("http://example.com/"));
Breadcrumbs::add(Breadcrumb::factory()->set_title("Crumb 2"));
Breadcrumbs::clear();
$this->assertSame(array(), Breadcrumbs::get());
}
示例2: get_list
public function get_list($id = 0)
{
$breadcrumbs = Breadcrumbs::get($id);
$categories = $id ? Category::find($id)->children : Category::where('parent', '=', 0)->get();
$products = $id ? Category::find($id)->products : array();
$this->layout->page_title = "Admin - Categories - List";
$this->layout->page_content = View::make('admin.categories.list')->with('id', $id)->with('breadcrumbs', $breadcrumbs)->with('categories', $categories)->with('products', $products);
}
示例3: setItemName
/**
* Set item name.
*
* @param integer $id The id of the item on which to set the name.
* @param string $name The name to set.
*
* @return boolean True on success
*
* @since 11.1
*/
public function setItemName($id, $name)
{
// [!] HUBzero compatibility
if (class_exists('\\Breadcrumbs')) {
return \Breadcrumbs::get($id)->name = $name;
}
// Initialize variables
$ret = false;
if (isset($this->_pathway[$id])) {
$this->_pathway[$id]->name = $name;
$ret = true;
}
return $ret;
}