本文整理汇总了PHP中Navigation::addPage方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::addPage方法的具体用法?PHP Navigation::addPage怎么用?PHP Navigation::addPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::addPage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: contextBackend
public function contextBackend()
{
$root = \Navigation::addPage(['id' => 'pages', 'title' => 'pages::core.title.pages.list', 'url' => route('backend.page.list'), 'permissions' => 'page::list', 'priority' => 100, 'icon' => 'sitemap']);
if ($page = \Navigation::getPages()->findById('design')) {
$page->addPage(['id' => 'layouts', 'title' => 'pages::core.title.layouts.list', 'url' => route('backend.layout.list'), 'permissions' => 'layout::list', 'priority' => 100, 'icon' => 'desktop']);
}
}
示例2: contextBackend
public function contextBackend()
{
$datasourcePage = \Navigation::addPage(['id' => 'datasource', 'title' => 'datasource::core.title.section', 'priority' => 500, 'icon' => 'tasks']);
$sections = app('datasource.manager')->getRootSections();
foreach ($sections as $dsSection) {
$page = new Section($dsSection);
if ($dsSection->getSetting('show_in_root_menu')) {
\Navigation::addPage($page);
} else {
$datasourcePage->addPage($page);
}
}
$folders = SectionFolder::with('sections')->get();
foreach ($folders as $folder) {
if (count($folder->sections) > 0) {
$folderPage = $datasourcePage->addPage(new Folder($folder));
foreach ($folder->sections as $dsSection) {
$folderPage->addPage(new Section($dsSection));
}
}
}
if (count($types = app('datasource.manager')->getAvailableTypes()) > 0) {
$create = $datasourcePage->addPage(['title' => 'datasource::core.button.create', 'icon' => 'plus', 'id' => 'datasource-create']);
foreach ($types as $type => $object) {
$create->addPage(new SectionType($object));
}
}
}
示例3: contextBackend
public function contextBackend()
{
$navigation = \Navigation::addPage(['id' => 'documentation', 'icon' => 'book', 'title' => 'userguide::core.title', 'priority' => 9999]);
$modules = array_reverse(config('userguide.modules'));
// Remove modules that have been disabled via config
foreach ($modules as $key => $value) {
if (!config('userguide.modules.' . $key . '.enabled')) {
continue;
}
$title = config('userguide.modules.' . $key . '.name');
if (empty($title)) {
$title = $key;
}
$navigation->addPage(['id' => $key, 'icon' => 'leanpub', 'title' => $title, 'url' => route('backend.userguide.docs', [$key])]);
}
}