本文整理汇总了PHP中RGFormsModel::get_input方法的典型用法代码示例。如果您正苦于以下问题:PHP RGFormsModel::get_input方法的具体用法?PHP RGFormsModel::get_input怎么用?PHP RGFormsModel::get_input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RGFormsModel
的用法示例。
在下文中一共展示了RGFormsModel::get_input方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_default_value
public static function get_default_value($field, $input_id)
{
if (!is_array($field->choices)) {
if (is_array($field->inputs)) {
$input = RGFormsModel::get_input($field, $input_id);
return rgar($input, 'defaultValue');
} else {
return IS_ADMIN ? $field->defaultValue : GFCommon::replace_variables_prepopulate($field->defaultValue);
}
} else {
if ($field->type == 'checkbox') {
for ($i = 0, $count = sizeof($field->inputs); $i < $count; $i++) {
$input = $field->inputs[$i];
$choice = $field->choices[$i];
if ($input['id'] == $input_id && rgar($choice, 'isSelected')) {
return $choice['value'];
}
}
return '';
} else {
foreach ($field->choices as $choice) {
if (rgar($choice, 'isSelected') || $field->type == 'post_category') {
return $choice['value'];
}
}
return '';
}
}
}
示例2: get_default_value
public static function get_default_value($field, $input_id)
{
if (!is_array(rgar($field, "choices"))) {
if (is_array(rgar($field, "inputs"))) {
$input = RGFormsModel::get_input($field, $input_id);
return rgar($input, "defaultValue");
} else {
return IS_ADMIN ? $field["defaultValue"] : GFCommon::replace_variables_prepopulate($field["defaultValue"]);
}
} else {
if ($field["type"] == "checkbox") {
for ($i = 0, $count = sizeof($field["inputs"]); $i < $count; $i++) {
$input = $field["inputs"][$i];
$choice = $field["choices"][$i];
if ($input["id"] == $input_id && $choice["isSelected"]) {
return $choice["value"];
}
}
return "";
} else {
foreach ($field["choices"] as $choice) {
if ($choice["isSelected"] || $field["type"] == "post_category") {
return $choice["value"];
}
}
return "";
}
}
}
示例3: get_default_value
public static function get_default_value($field, $input_id)
{
if (!is_array($field->choices)) {
// if entry is saved in separate inputs get requsted input's default value ($input_id = 2.1)
// some fields (like Date, Time) do not save their values in separate inputs and are correctly filtered out by this condition ($input_id = 2)
// other fields (like Email w/ Confirm-enabled) also do not save their values in separate inputs but *should be* processed as input-specific submissions ($input_id = 2)
if (is_array($field->get_entry_inputs()) || $field->get_input_type() == 'email' && is_array($field->inputs)) {
$input = RGFormsModel::get_input($field, $input_id);
return rgar($input, 'defaultValue');
} else {
$value = $field->get_value_default();
if (!IS_ADMIN) {
if (is_array($value)) {
foreach ($value as &$_value) {
$_value = GFCommon::replace_variables_prepopulate($_value);
}
} else {
$value = GFCommon::replace_variables_prepopulate($value);
}
}
return $value;
}
} else {
if ($field->type == 'checkbox') {
for ($i = 0, $count = sizeof($field->inputs); $i < $count; $i++) {
$input = $field->inputs[$i];
$choice = $field->choices[$i];
if ($input['id'] == $input_id && rgar($choice, 'isSelected')) {
return $choice['value'];
}
}
return '';
} else {
foreach ($field->choices as $choice) {
if (rgar($choice, 'isSelected') || $field->type == 'post_category') {
return $choice['value'];
}
}
return '';
}
}
}
示例4: get_input
public static function get_input($field, $id)
{
return RGFormsModel::get_input($field, $id);
}
示例5: get_row_label
/**
* Retrieves the row label from the specified input.
*
* @param string $input_id The ID of the input currently being processed.
*
* @return string
*/
public function get_row_label($input_id)
{
$input = RGFormsModel::get_input($this, $input_id);
return trim(rgar($input, 'label'));
}