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

OptionMeaning
$funcCallback fn ($extra, $replace, $form) returning the row HTML; also callback / function / func in the options.
descLabel (the callback decides whether to wrap the content in a row).

Example

$74.70

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