PodsForm::row PHP Method

row() public static method

Output a row (label, field, and comment)
Since: 2.0
public static row ( string $name, mixed $value, string $type = 'text', array $options = null, array $pod = null, integer $id = null ) : string
$name string Field name
$value mixed Field value
$type string Field type
$options array Field options
$pod array Pod data
$id integer Item ID
return string Row HTML
    public static function row($name, $value, $type = 'text', $options = null, $pod = null, $id = null)
    {
        $options = self::options(null, $options);
        ob_start();
        pods_view(PODS_DIR . 'ui/fields/_row.php', compact(array_keys(get_defined_vars())));
        $output = ob_get_clean();
        return apply_filters('pods_form_ui_field_row', $output, $name, $value, $options, $pod, $id);
    }

Usage Example

        } else {
            $value = pods_var_raw($field_name, $field, $value);
        }
        if (in_array($field_option['type'], PodsForm::file_field_types())) {
            if (is_array($value) && !isset($value['id'])) {
                foreach ($value as $k => $v) {
                    if (isset($v['id'])) {
                        $value[$k] = $v['id'];
                    }
                }
            }
        }
        ?>
        <div class="pods-field-option">
            <?php 
        echo PodsForm::row($row_name, $value, $field_option['type'], $field_option);
        ?>
        </div>
        <?php 
    } else {
        ?>
        <div class="pods-field-option-group">
            <p class="pods-field-option-group-label">
                <?php 
        echo $field_option['label'];
        ?>
            </p>

            <div class="pods-pick-values pods-pick-checkbox">
                <ul>
                    <?php