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