本文整理汇总了PHP中action_menu::get_primary_actions方法的典型用法代码示例。如果您正苦于以下问题:PHP action_menu::get_primary_actions方法的具体用法?PHP action_menu::get_primary_actions怎么用?PHP action_menu::get_primary_actions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类action_menu
的用法示例。
在下文中一共展示了action_menu::get_primary_actions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_action_menu
/**
* Renders an action menu component.
*
* ARIA references:
* - http://www.w3.org/WAI/GL/wiki/Using_ARIA_menus
* - http://stackoverflow.com/questions/12279113/recommended-wai-aria-implementation-for-navigation-bar-menu
*
* @param action_menu $menu
* @return string HTML
*/
public function render_action_menu(action_menu $menu) {
$menu->initialise_js($this->page);
$output = html_writer::start_tag('div', $menu->attributes);
$output .= html_writer::start_tag('ul', $menu->attributesprimary);
foreach ($menu->get_primary_actions($this) as $action) {
if ($action instanceof renderable) {
$content = $this->render($action);
} else {
$content = $action;
}
$output .= html_writer::tag('li', $content, array('role' => 'presentation'));
}
$output .= html_writer::end_tag('ul');
$output .= html_writer::start_tag('ul', $menu->attributessecondary);
foreach ($menu->get_secondary_actions() as $action) {
if ($action instanceof renderable) {
$content = $this->render($action);
} else {
$content = $action;
}
$output .= html_writer::tag('li', $content, array('role' => 'presentation'));
}
$output .= html_writer::end_tag('ul');
$output .= html_writer::end_tag('div');
return $output;
}