本文整理汇总了PHP中renderer_base::render_skip_links方法的典型用法代码示例。如果您正苦于以下问题:PHP renderer_base::render_skip_links方法的具体用法?PHP renderer_base::render_skip_links怎么用?PHP renderer_base::render_skip_links使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类renderer_base
的用法示例。
在下文中一共展示了renderer_base::render_skip_links方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_top_of_body_code
/**
* Generate any HTML that needs to go at the start of the <body> tag.
*
* Normally, this method is called automatically by the code that prints the
* <head> tag. You should not normally need to call it in your own code.
*
* @param renderer_base $renderer
* @return string the HTML code to go at the start of the <body> tag.
*/
public function get_top_of_body_code(renderer_base $renderer)
{
// First the skip links.
$output = $renderer->render_skip_links($this->skiplinks);
// YUI3 JS needs to be loaded early in the body. It should be cached well by the browser.
$output .= $this->get_yui3lib_headcode();
// Add hacked jQuery support, it is not intended for standard Moodle distribution!
$output .= $this->get_jquery_headcode();
// Link our main JS file, all core stuff should be there.
$output .= html_writer::script('', $this->js_fix_url('/lib/javascript-static.js'));
// All the other linked things from HEAD - there should be as few as possible.
if ($this->jsincludes['head']) {
foreach ($this->jsincludes['head'] as $url) {
$output .= html_writer::script('', $url);
}
}
// Then the clever trick for hiding of things not needed when JS works.
$output .= html_writer::script("document.body.className += ' jsenabled';") . "\n";
$this->topofbodydone = true;
return $output;
}