本文整理汇总了PHP中Menu::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Menu::instance方法的具体用法?PHP Menu::instance怎么用?PHP Menu::instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu::instance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInstance
public static function getInstance()
{
if (self::$instance == null) {
self::$instance = new Menu();
}
return self::$instance;
}
示例2: getInstance
public static function getInstance()
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
示例3: render
function render()
{
$menu = Menu::instance();
$this->_view['all_menu'] = $menu->getAll();
$this->_view['current'] = $menu->getCurrentMainMenu();
return $this->_fetchView(dirname(__FILE__) . '/navmain_view.php');
}
示例4: me
public static function me()
{
if (is_null(self::$instance)) {
self::$instance = new Menu();
}
return self::$instance;
}
示例5: render
public function render()
{
$menu = Menu::instance('submenu')->render();
if (empty($menu)) {
return '';
}
return View::factory('widgets/submenu')->set(array('menu' => $menu))->render();
}
示例6: render
function render($return = false)
{
$context = $this->context->parent();
$menu = Menu::instance();
$this->view['all_menu'] = $menu->getAll();
$this->view['current'] = $menu->getCurrentMainMenu($context);
return $this->_renderBlock('navmain', $return);
}
示例7: render
function render()
{
$menu = Menu::instance();
$this->_view['menu'] = $menu;
$this->_view['main'] = $menu->getCurrentMainMenu();
$this->_view['current'] = $menu->getCurrentSubMenu($this->_view['main']['items']);
return $this->_fetchView(dirname(__FILE__) . '/submenu_view.php');
}
示例8: render
function render($return = false)
{
$context = $this->context->parent();
$menu = Menu::instance();
$this->view['menu'] = $menu;
$this->view['main'] = $menu->getCurrentMainMenu($context);
$this->view['current'] = $menu->getCurrentSubMenu($context, $this->view['main']['items']);
return $this->_renderBlock('submenu', $return);
}
示例9: run
public function run()
{
$menu = Menu::instance();
$manager = Manager::instance();
$settings = Settings::instance();
$attachment_edit = AttachmentEdit::instance();
$menu->set_manager($manager);
$menu->set_settings($settings);
$menu->init_pages();
add_action('wpod', array($menu, 'add_components'));
add_action('admin_enqueue_scripts', array($attachment_edit, 'enqueue_scripts'), 10, 1);
add_action('attachment_submitbox_misc_actions', array($attachment_edit, 'attachment_submitbox_misc_actions'), 100, 0);
add_filter('map_meta_cap', array($this, 'map_meta_cap'), 10, 4);
}
示例10: test2
function test2()
{
return Menu::instance('test2');
}
示例11: render
public function render($only_children = FALSE)
{
$this->rendered = TRUE;
if ($only_children === TRUE) {
$output = '';
foreach ($this->children as $child) {
$output .= Menu::instance()->get($child);
}
return $output;
}
$class = $this->active === TRUE ? 'active' : '';
if (empty($this->children)) {
return '<li class="' . $class . '">' . html::anchor($this->uri, html::specialchars($this->title), array('class' => $class)) . '</li>';
}
$output = '<li class="' . $class . '">' . html::anchor($this->uri, html::specialchars($this->title), array('class' => $class));
$output .= '<ul>';
foreach ($this->children as $child) {
$output .= Menu::instance()->get($child)->render();
}
$output .= '</ul></li>';
return $output;
}
示例12:
</head>
<body>
<?php
Event::run('s7n.theme.page_top');
?>
<div id="header">
<div class="widthfix">
<div class="logo">
<h1><?php
echo html::anchor('/', config::get('s7n.site_title'));
?>
</h1>
</div>
<div class="clear"></div>
<?php
echo Menu::instance();
?>
</div>
</div>
<div id="content">
<div id="article">
<div class="entry">
<?php
echo $content;
?>
</div>
</div>
<div id="sidebar">
<?php
echo Widget::factory('Submenu');
?>
示例13:
<?php
$leftMenu = Menu::instance('admin-menu');
$rightMenu = Menu::instance('admin-menu-right');
/**
* @see https://github.com/pingpong-labs/menus
*
* @example adding additional menu.
*
* $leftMenu->url('your-url', 'The Title');
*
* $leftMenu->route('your-route', 'The Title');
*/
示例14:
<?php
$leftMenu = Menu::instance('admin-menu');
$rightMenu = Menu::instance('admin-menu-right');
$shopMenu = Menu::instance('shop-menu');
/**
* @see https://github.com/pingpong-labs/menus
*
* @example adding additional menu.
*
* $leftMenu->url('your-url', 'The Title');
*
* $leftMenu->route('your-route', 'The Title');
*/
示例15: function
<?php
$menu = Menu::instance('sidebar');
$menu->dropdown('Settings', function ($sub) {
$sub->url('administrator/settings', 'General', 1, ['icon' => 'fa fa-circle-o']);
}, 6, ['icon' => 'fa fa-wrench']);