本文整理汇总了PHP中EEH_Form_Fields::radio方法的典型用法代码示例。如果您正苦于以下问题:PHP EEH_Form_Fields::radio方法的具体用法?PHP EEH_Form_Fields::radio怎么用?PHP EEH_Form_Fields::radio使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEH_Form_Fields
的用法示例。
在下文中一共展示了EEH_Form_Fields::radio方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generate_form_input
/**
* generate_form_input
*
* @param EE_Question_Form_Input $QFI
* @return string HTML
*/
static function generate_form_input(EE_Question_Form_Input $QFI)
{
if (isset($QFI->QST_admin_only) && $QFI->QST_admin_only && !is_admin()) {
return '';
}
$QFI = self::_load_system_dropdowns($QFI);
$QFI = self::_load_specialized_dropdowns($QFI);
//we also need to verify
$display_text = $QFI->get('QST_display_text');
$input_name = $QFI->get('QST_input_name');
$answer = EE_Registry::instance()->REQ->is_set($input_name) ? EE_Registry::instance()->REQ->get($input_name) : $QFI->get('ANS_value');
$input_id = $QFI->get('QST_input_id');
$input_class = $QFI->get('QST_input_class');
// $disabled = $QFI->get('QST_disabled') ? ' disabled="disabled"' : '';
$disabled = $QFI->get('QST_disabled') ? TRUE : FALSE;
$required_label = apply_filters(' FHEE__EEH_Form_Fields__generate_form_input__required_label', '<em>*</em>');
$QST_required = $QFI->get('QST_required');
$required = $QST_required ? array('label' => $required_label, 'class' => 'required needs-value', 'title' => $QST_required) : array();
$use_html_entities = $QFI->get_meta('htmlentities');
$required_text = $QFI->get('QST_required_text') != '' ? $QFI->get('QST_required_text') : __('This field is required', 'event_espresso');
$required_text = $QST_required ? "\n\t\t\t" . '<div class="required-text hidden">' . self::prep_answer($required_text, $use_html_entities) . '</div>' : '';
$label_class = 'espresso-form-input-lbl';
$QST_options = $QFI->options(true, $answer);
$options = is_array($QST_options) ? self::prep_answer_options($QST_options) : array();
$system_ID = $QFI->get('QST_system');
$label_b4 = $QFI->get_meta('label_b4');
$use_desc_4_label = $QFI->get_meta('use_desc_4_label');
switch ($QFI->get('QST_type')) {
case 'TEXTAREA':
return EEH_Form_Fields::textarea($display_text, $answer, $input_name, $input_id, $input_class, array(), $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
break;
case 'DROPDOWN':
return EEH_Form_Fields::select($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, TRUE);
break;
case 'RADIO_BTN':
return EEH_Form_Fields::radio($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities, $label_b4, $use_desc_4_label);
break;
case 'CHECKBOX':
return EEH_Form_Fields::checkbox($display_text, $answer, $options, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $label_b4, $system_ID, $use_html_entities);
break;
case 'DATE':
return EEH_Form_Fields::datepicker($display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
break;
case 'TEXT':
default:
return EEH_Form_Fields::text($display_text, $answer, $input_name, $input_id, $input_class, $required, $required_text, $label_class, $disabled, $system_ID, $use_html_entities);
break;
}
}