Javatpoint Logo
Javatpoint Logo

Phalcon Forms

It handles creation and maintenance of forms in the web application. Now, as we have designed a basic web-app before we would be adding signup form.

Designing Signup form

Change the index.phtml viewfile, add the signup page link as a controller.

app/views/index/index.phtml

OUTPUT:

Phalcon Forms 1

Now, we write the signup controller

app/controllers/SignupController.php

Initializing Form

In this form, we provide the form definition i.e. structure of form is provided.

app/views/signup/index.phtml

OUTPUT

Phalcon Forms 2

Validating Form

Phalcon forms are integrated with the validation component to offer instant validation.


Form Elements

Phalcon provides a set of built-in elements to use in your forms. All these elements are located inside Phalcon\Forms\Element.

Name Description
Phalcon\Forms\Element\Text Generate INPUT[type=text] elements
Phalcon\Forms\Element\Password Generate INPUT[type=password] elements
Phalcon\Forms\Element\Select Generate SELECT tag (combo lists) elements based on choices
Phalcon\Forms\Element\Check Generate INPUT[type=check] elements
Phalcon\Forms\Element\TextArea Generate TEXTAREA elements
Phalcon\Forms\Element\Hidden Generate INPUT[type=hidden] elements
Phalcon\Forms\Element\File Generate INPUT[type=file] elements
Phalcon\Forms\Element\Date Generate INPUT[type=date] elements
Phalcon\Forms\Element\Numeric Generate INPUT[type=number] elements
Phalcon\Forms\Element\Submit Generate INPUT[type=submit] elements

Next TopicPhalcon Images





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA