func() form()
A form row rendered by your callback, which gets the options, the values and the form.
form()->func($name, $func, $extra = [], $replace = [])Options
| Option | Meaning |
|---|---|
$func | Callback fn ($extra, $replace, $form) returning the row HTML; also callback / function / func in the options. |
desc | Label (the callback decides whether to wrap the content in a row). |
Example
Code
$row = ['price' => 24.9, 'qty' => 3];
return form($row)
->number('qty')
->func('total', fn ($extra, $replace, $form) => $form->_row_html('<b>$' . number_format($replace['price'] * $replace['qty'], 2) . '</b>', ['desc' => 'Total']));Notes
$form->_row_html($html, ['desc' => ...])wraps content in the label and row markup of the current css framework.
See also: form/container, table/func