Form Generation Library


Form Open

The following method will open the form with a form tag utilizing the form_open() form helper function.

open (string action [, string name|id, string|array attributes])

Note: The default method is POST. If you want to use GET you can either add "method=GET" as an attribute parameter or use the method() function.

If your form contains an upload() or iupload() element the attribute enctype="multipart/form-data" will be added automatically.

Usage Example

$this->form
->open('login', 'login_form')
...

echo $this->form->get();
will produce <form name="login_form" action="login" method="POST" />
...

method = "GET"

$this->form
->open('login', 'login_form', 'class="form"')
->method('GET');

echo $this->form->get();
will produce <form name="login_form" action="login" method="GET" class="form" />