本文整理汇总了PHP中RGFormsModel::get_label方法的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel::get_label方法的具体用法?PHP RGFormsModel::get_label怎么用?PHP RGFormsModel::get_label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RGFormsModel
的用法示例。
在下文中一共展示了RGFormsModel::get_label方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_routing_fields
private static function get_routing_fields($form, $selected_field_id)
{
$str = "";
foreach ($form["fields"] as $field) {
$input_type = RGFormsModel::get_input_type($field);
$field_label = RGFormsModel::get_label($field);
if (in_array($input_type, self::$supported_fields)) {
$selected = $field["id"] == $selected_field_id ? "selected='selected'" : "";
$str .= "<option value='" . $field["id"] . "' " . $selected . ">" . $field_label . "</option>";
}
}
return $str;
}
示例2: get_payment_choices
protected function get_payment_choices($form)
{
$fields = GFAPI::get_fields_by_type($form, array('product'));
$choices = array(array('label' => esc_html__('Select a product field', 'gravityforms'), 'value' => ''));
foreach ($fields as $field) {
$field_id = $field['id'];
$field_label = RGFormsModel::get_label($field);
$choices[] = array('value' => $field_id, 'label' => $field_label);
}
return $choices;
}
示例3: get_product_options
private static function get_product_options($form, $selected_field)
{
$str = "<option value=''>" . __("Select a field", "gravityformspaypal") . "</option>";
$fields = GFCommon::get_fields_by_type($form, array("product"));
foreach ($fields as $field) {
$field_id = $field["id"];
$field_label = RGFormsModel::get_label($field);
$selected = $field_id == $selected_field ? "selected='selected'" : "";
$str .= "<option value='" . $field_id . "' " . $selected . ">" . $field_label . "</option>";
}
$selected = $selected_field == 'all' ? "selected='selected'" : "";
$str .= "<option value='all' " . $selected . ">" . __("Form Total", "gravityformspaypal") . "</option>";
return $str;
}
示例4: get_routing_fields
private static function get_routing_fields($form, $selected_field_id)
{
$str = '';
foreach ($form['fields'] as $field) {
$input_type = RGFormsModel::get_input_type($field);
$field_label = RGFormsModel::get_label($field);
if (in_array($input_type, self::get_routing_field_types())) {
$selected = $field->id == $selected_field_id ? "selected='selected'" : '';
$str .= "<option value='" . $field->id . "' " . $selected . '>' . $field_label . '</option>';
}
}
return $str;
}
示例5: get_label
public static function get_label($field, $input_id = 0, $input_only = false)
{
return RGFormsModel::get_label($field, $input_id, $input_only);
}
示例6: get_payment_choices
protected function get_payment_choices($form)
{
$fields = GFCommon::get_fields_by_type($form, array("product"));
$choices = array(array("label" => __("Select a product field", "gravityforms"), "value" => ""));
foreach ($fields as $field) {
$field_id = $field["id"];
$field_label = RGFormsModel::get_label($field);
$choices[] = array("value" => $field_id, "label" => $field_label);
}
return $choices;
}
示例7: get_label
public static function get_label($field, $input_id = 0, $input_only = false, $allow_admin_label = true)
{
return RGFormsModel::get_label($field, $input_id, $input_only, $allow_admin_label);
}
示例8: get_product_options
/**
* @param $form
* @param $selected_field
* @param $form_total
*
* @return string
*/
public static function get_product_options($form, $selected_field, $form_total)
{
$str = "<option value=''>" . __('Select a field', 'gfp-stripe') . '</option>';
$fields = GFCommon::get_fields_by_type($form, array('product'));
foreach ($fields as $field) {
$field_id = $field["id"];
$field_label = RGFormsModel::get_label($field);
$selected = $field_id == $selected_field ? "selected='selected'" : "";
$str .= "<option value='" . $field_id . "' " . $selected . ">" . $field_label . '</option>';
}
if ($form_total) {
$selected = $selected_field == 'all' ? "selected='selected'" : "";
$str .= "<option value='all' " . $selected . ">" . __('Form Total', 'gfp-stripe') . "</option>";
}
return $str;
}