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

OptionMeaning
$typeMethod name (text, password, save_and_back...).
$name, $descField name and label; %key takes the text from $replace[key] (label text escaped).
$extraOptions 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