input(), input_padded() table()

A text input in each row, named field[row id], to edit one field of many rows at once; input_padded() indents tree rows.

table()->input($name, $extra = [])
table()->input_padded($name, $extra = [])

Options

OptionMeaning
propose_url_fromField whose text proposes a URL slug when the value is empty.
paddingIndent by the level of the row (what input_padded() sets).
(html input options)Every option of html()->input(): class, style, placeholder...

Example

Name Slug
└

Code

$rows = [
    1 => ['id' => 1, 'name' => 'Furniture', 'slug' => 'furniture', 'level' => 0],
    2 => ['id' => 2, 'name' => 'Office chairs', 'slug' => '', 'level' => 1],
];
return table($rows, ['no_pages' => 1])
    ->input_padded('name')
    ->input('slug', ['propose_url_from' => 'name']);

Notes

  • The inputs post as name[1], name[2]...; ids are input_<field>_<row id>.
  • It calls form().

See also: table/form, table/text_padded