O'Reilly logo

Zend Framework 2 Cookbook by Josephus Callaars

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating forms

This recipe involves different ways of creating forms, and after that we will talk about how elements are added to the form. In the last part of this recipe we will discuss how to validate forms, and the best way of accomplishing this.

Getting ready…

A basic ZF2 skeleton application, with at least one module where we can work in, is necessary to create and output forms.

If we want to use form annotations, we also require Doctrine\Common to be initiated in the skeleton as it has the parsing engine to parse the annotations. If we are using composer (which comes with the Zend Framework 2 skeleton) we can simply update our composer.json by adding the following line to the required section:

"doctrine/common": ">=2.1",

Tip

Make sure the comma ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required