本文整理汇总了PHP中admin_setting_configselect::output_select_html方法的典型用法代码示例。如果您正苦于以下问题:PHP admin_setting_configselect::output_select_html方法的具体用法?PHP admin_setting_configselect::output_select_html怎么用?PHP admin_setting_configselect::output_select_html使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin_setting_configselect
的用法示例。
在下文中一共展示了admin_setting_configselect::output_select_html方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: output_select_html
/**
* Returns XHTML select field
*
* Ensure the options are loaded, and generate the XHTML for the select
* element and any warning message. Separating this out from output_html
* makes it easier to subclass this class.
*
* @param string $data the option to show as selected.
* @param string $current the currently selected option in the database, null if none.
* @param string $default the default selected option.
* @return array the HTML for the select element, and a warning message.
*/
public function output_select_html($data, $current, $default, $extraname = '')
{
if (!$this->load_choices() or empty($this->choices)) {
return array('', '');
}
if (is_null($current)) {
// First run.
if (!is_null($default) and empty($data)) {
$data = $default;
}
}
return parent::output_select_html($data, $current, $default, $extraname);
}