News Feed
Sections




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

Rob Allen:
Integrating ZF2 forms into Slim
August 26, 2014 @ 09:40:47

Rob Allen has a helpful post if you've ever wanted to take advantage of the simplicity of the Slim framework and the power of the Zend Framework 2 forms. In this latest post he walks you through the process of setting it all up and using the ZF2 elements outside of the main framework.

Let's say that you want to use Zend Framework 2′s Form component outside of ZF2 itself. In this case, a Slim application. It turns out that Composer makes this quite easy, though there's quite a lot of code involved, so this is a long article. Start with a really simple Slim Application...

His simple Slim application - just one route - handles both the GET and POST actions and uses several ZF2 components besides just the Form (dependencies mostly). He shows you the updates and additions you'll need to make to the service manager configuration and how to set up some custom validation and the form object in the controller. His example form only has two elements, an email field and a submit button and validation is done on the email address when it's submitted. Finally he includes the View object, extended from Slim's that combines some of the ZF2 and Slim handling to correctly render the form.

0 comments voice your opinion now!
form integration slim zendframework2 tutorial validation

Link: http://akrabat.com/zend-framework-2/integrating-zf2-forms-into-slim/

blog comments powered by Disqus

Similar Posts

DesignShack.com: How to Build a Dynamic Imgur Upload App Using jQuery & PHP

DeveloperTutorials.com: Upload Files to MySQL using PHP Tutorial

NETTUTS.com: Building the Back-End of a Photo Site

Zend Developer Zone: Managing CSS and JavaScript files within a Zend Framework App

Wes Ray's Blog: Configuring Fedora 12 PHP/MySQL Server with Nginx and reverse proxy to Apache


Community Events

Don't see your event here?
Let us know!


introduction community laravel interview install laravel5 php7 release series conference extension library language podcast opinion performance example voicesoftheelephpant api framework

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework