本文整理汇总了PHP中default_questiontype::get_html_head_contributions方法的典型用法代码示例。如果您正苦于以下问题:PHP default_questiontype::get_html_head_contributions方法的具体用法?PHP default_questiontype::get_html_head_contributions怎么用?PHP default_questiontype::get_html_head_contributions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类default_questiontype
的用法示例。
在下文中一共展示了default_questiontype::get_html_head_contributions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function get_html_head_contributions(&$question, &$state)
{
global $PAGE;
parent::get_html_head_contributions($question, $state);
$PAGE->requires->js('/lib/overlib/overlib.js', true);
$PAGE->requires->js('/lib/overlib/overlib_cssstyle.js', true);
}
示例2:
/**
* If this question type requires extra CSS or JavaScript to function,
* then this method will return an array of <link ...> tags that reference
* those stylesheets. This function will also call require_js()
* from ajaxlib.php, to get any necessary JavaScript linked in too.
*
* The YUI libraries needed for dragdrop have been added to the default
* set of libraries.
*
* The two parameters match the first two parameters of print_question.
*
* @param object $question The question object.
* @param object $state The state object.
*
* @return an array of bits of HTML to add to the head of pages where
* this question is print_question-ed in the body. The array should use
* integer array keys, which have no significance.
*/
function get_html_head_contributions(&$question, &$state)
{
// Load YUI libraries
require_js("yui_yahoo");
require_js("yui_event");
require_js("yui_dom");
require_js("yui_dragdrop");
require_js("yui_animation");
$contributions = parent::get_html_head_contributions($question, $state);
return $contributions;
}
示例3:
/**
* Add styles.css to the page's header
*/
function get_html_head_contributions(&$question, &$state)
{
return parent::get_html_head_contributions($question, $state);
}
示例4:
/**
* Add styles.css to the page's header
*/
function get_html_head_contributions(&$question, &$state)
{
$this->require_once_css();
parent::get_html_head_contributions($question, $state);
}