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