lithium\template\helper\Form::_fields PHP Method

_fields() protected method

Helper method used by Form::field() for iterating over an array of multiple fields.
See also: lithium\template\helper\Form::field()
protected _fields ( array $fields, array $options = [] ) : string
$fields array An array of fields to render.
$options array The array of options to apply to all fields in the `$fields` array. See the `$options` parameter of the `field` method for more information.
return string Returns the fields rendered by `field()`, each separated by a newline.
    protected function _fields(array $fields, array $options = array())
    {
        $result = array();
        foreach ($fields as $field => $label) {
            if (is_numeric($field)) {
                $field = $label;
                unset($label);
            }
            $result[] = $this->field($field, compact('label') + $options);
        }
        return join("\n", $result);
    }