Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

MaltBlue.com:
Zend Framework 2 Forms - Simple and Available Everywhere
Apr 04, 2013 @ 16:29:49

Matt Setter has a new post to his site today about forms in Zend Framework 2 including a full example on how to use them to create a form for user information (first name, last name).

I think it goes without saying, forms are one of the central elements of any web-based application. They’re used for everything from logging in, to searching content and managing information. Given that, they should be first-class citizens, able to be developed and reused with relative ease. [...] However, given the amount of options, configurability and flexibility required, this isn’t always easy. [...] In today’s post, I’m going to assume you have a basic understanding of how forms work now. [...] I’m going to show you how to create flexible, reusable forms in one module and by the power of the ServiceManager reuse them throughout your application.

He starts with the inclusion of a dependency needed for his example - the ZfcUser component (installed via Composer). He then moves on to the actual code for the form creating a reusable module, an entity class for the User and the Fieldset/Form classes for the contents of the form. He also includes the code for the controller action and the view that outputs the form itself and handles the repopulation automagically (and includes a CSRF token).

tagged: zendframework2 form tutorial module zfcuser user

Link: http://www.maltblue.com/zend-framework/simple-zend-framework-2-forms

Evan Coury:
Getting started with the ZF2 skeleton and ZfcUser
Jul 18, 2012 @ 18:56:14

Evan Coury has a recent post to his site showing you how to set up and use the ZF2 skeleton and ZfcUser components of the Zend Framework 2.

This is meant to be a short, easy-to-follow tutorial to help you get started with Zend Framework 2.0 and add perhaps one of the most common modules, ZfcUser. By the end of this tutorial, you’ll have a simple ZF2 application with user registration and authentication capabilities.

He breaks it up into a three different steps:

  • Getting the skeleton
  • Setting up a database connection
  • Installing ZfcUser

He also provides some links to other handy resources and libraries you can use to extend the ZfcUser functionality with things like ACL support, two-stage signup and Github authentication integration.

tagged: zendframework2 skeleton application zfcuser authentication tutorial

Link:


Trending Topics: