本文整理匯總了PHP中GF_Field::get_description方法的典型用法代碼示例。如果您正苦於以下問題:PHP GF_Field::get_description方法的具體用法?PHP GF_Field::get_description怎麽用?PHP GF_Field::get_description使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GF_Field
的用法示例。
在下文中一共展示了GF_Field::get_description方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_field_content
public static function get_field_content(GF_Field $field, $value, $form, $entry)
{
$validation_message = $field->failed_validation && !empty($field->validation_message) ? sprintf("<div class='gfield_description validation_message'>%s</div>", $field->validation_message) : '';
$required_div = $field->isRequired ? sprintf("<span class='gfield_required'>%s</span>", $field->isRequired ? '*' : '') : '';
$target_input_id = $field->get_first_input_id($form);
$for_attribute = empty($target_input_id) ? '' : "for='{$target_input_id}'";
$form_id = absint($form['id']);
$td_id = 'field_' . $form_id . '_' . $field->id;
$td_id = esc_attr($td_id);
$description = $field->get_description($field->description, 'gfield_description');
$field->conditionalLogicFields = GFFormDisplay::get_conditional_logic_fields($form, $field->id);
$field_input = self::get_field_input($field, $value, $entry['id'], $form_id, $form);
if ($field->is_description_above($form)) {
$clear = "<div class='gf_clear'></div>";
$field_input = $description . $field_input . $validation_message . $clear;
} else {
$field_input = $field_input . $description . $validation_message;
}
$field_content = "<tr valign='top'><td colspan='2' class='detail-view' id='{$td_id}'><ul><li><label class='gfield_label' {$for_attribute} >" . esc_html(rgar($field, 'label')) . $required_div . "</label>{$field_input}</li></ul> </td></tr>";
return $field_content;
}