tpl_row() form()
One form row from a template: the {form_row("text","login","Login")} tag of the template engine calls it.
form()->tpl_row($type = 'input', $replace = [], $name = '', $desc = '', $extra = [])Options
| Option | Meaning |
|---|---|
$type | Method name (text, password, save_and_back...). |
$name, $desc | Field name and label; %key takes the text from $replace[key] (label text escaped). |
$extra | Options array, or a string key1=val1;key2=val2, or (any other string) the edit_link. |
Example
Code
$replace = ['login' => 'anna', 't_password' => 'Your password'];
$form = _class('form2');
return $form->tpl_row('text', $replace, 'login', 'Login') . $form->tpl_row('password', $replace, 'pswd', '%t_password');Notes
- In a template:
{form_row('form_begin')} {form_row('text','login')} {form_row('save')} {form_row('form_end')}.
See also: form/array_to_form, table/tpl_row