本文整理汇总了PHP中Walker_Nav_Menu::start_lvl方法的典型用法代码示例。如果您正苦于以下问题:PHP Walker_Nav_Menu::start_lvl方法的具体用法?PHP Walker_Nav_Menu::start_lvl怎么用?PHP Walker_Nav_Menu::start_lvl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Walker_Nav_Menu
的用法示例。
在下文中一共展示了Walker_Nav_Menu::start_lvl方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start_lvl
public function start_lvl(&$output, $depth = 0, $args = array())
{
$html = '';
parent::start_lvl($html, $depth, $args);
$html = str_replace('sub-menu', 'dropdown-menu', $html);
$output .= $html;
}
示例2: array
function start_lvl(&$output, $depth = 0, $args = array())
{
if (0 == $depth) {
return;
}
parent::start_lvl($output, $depth, $args);
}
示例3: start_lvl
/**
* Overload Walker_Nav_Menu::start_lvl to add the 'dropdown-menu' class
* so sub-menu items work with Bootstrap out of the box.
*/
public function start_lvl(&$output, $depth = 0, $args = [])
{
parent::start_lvl($output, $depth, $args);
$args->link_before = '';
$args->link_after = '';
$output = preg_replace('/sub-menu/', 'sub-menu dropdown-menu', $output);
}
示例4:
function start_lvl(&$output, $depth, $args)
{
if (!$args->dropdown) {
parent::start_lvl($output, $depth, $args);
} else {
$indent = str_repeat("\t", $depth);
}
// don't output children opening tag (`<ul>`)
}
示例5: start_lvl
public function start_lvl(&$output, $depth = 0, $args = array())
{
$item_output = '';
parent::start_lvl($item_output, $depth, $args);
if ($this->in_mega_menu) {
// mega-menu item level greater than 2 - start a default WordPress start_lvl
if ($depth >= 1) {
$this->last_lvl .= $item_output;
}
return;
}
$output .= $item_output;
}
示例6: start_lvl
/**
* (non-PHPdoc)
* @see Walker_Nav_Menu::start_lvl()
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of page. Used for padding.
*/
public function start_lvl(&$output, $depth)
{
parent::start_lvl(&$output, $depth);
$this->remove_unwanted_chars(&$output);
}
示例7: array
function start_lvl(&$output, $depth = 0, $args = array())
{
parent::start_lvl($output, $depth, $args);
}
示例8: array
function start_lvl(&$output, $depth = 0, $args = array())
{
parent::start_lvl($output, $depth, $args);
$this->level++;
$this->count[$this->level] = 0;
}
示例9: start_lvl
/**
* @see Walker::start_lvl()
* @since 3.0.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of page. Used for padding.
*/
public function start_lvl(&$output, $depth = 0, $args = array())
{
parent::start_lvl($output, $depth, $args);
$pos = strrpos($output, '">', -1);
$output = substr_replace($output, ' dropdown-menu" role="menu">', $pos);
}
示例10: array
/**
* @see Walker::start_lvl()
* @since 3.0.0
*
* @param string $output Passed by reference. Used to append additional content.
* @param int $depth Depth of page. Used for padding.
*/
function start_lvl(&$output, $depth = 0, $args = array())
{
if ($this->in_current_menu && $depth > 0) {
parent::start_lvl($output, $depth, $args);
}
}
示例11: array
function start_lvl(&$output, $depth = 0, $args = array())
{
$output .= '<span class="subnav-close"></span>';
parent::start_lvl($output, $depth, $args);
}