O'Reilly logo

Zend Framework 2.0 by Example Beginner's Guide by Krishna Shasankar V

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

Time for action – creating a registration form

To create our first registration form, we will create a new controller to display a registration form; we will also create new forms and views. We need to make the following changes to the Users module:

  1. Form – We will also need to create a registration form under src/Users/Form/RegisterForm.php:
    1. The RegisterForm class extends Zend\Form\Form; the form's configuration is added to the constructor:
      <?php // filename : module/Users/src/Users/Form/RegisterForm.php namespace Users\Form; use Zend\Form\Form; class RegisterForm extends Form { public function __construct($name = null) { parent::__construct('Register'); $this->setAttribute('method', 'post'); $this->setAttribute('enctype','multipart/form-data'); ...

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