本文整理匯總了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;
}