News Feed
Jobs Feed
Sections




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

Jani Hartikainen' Blog:
Database backed Zend_Form elements
March 09, 2009 @ 08:45:27

Jani Hartikainen has a new post that should interest the Zend Framework developers out there - a look at automatically querying the database to fill in the right option values for a Zend_Form element.

It's not very tricky to query a database, and fill a Zend_Form element's possible values from the resultset, but it can be quite boring and extraneous code... We could also create an element which we can give some SQL, and it'll fill itself automatically! This way you can even define database-backed elements in XML or INI configuration files.

He starts with a simple Select element type example and builds from there. He creates a DbSelect layer for the element and with the help of a main method, _performSelect, the script can create a new instance of the CU_Form_Element_DbSelect to pull in the options from the SQL (given in the "dbSelect" parameter).

0 comments voice your opinion now!
database backend select option zendform zendframework query


blog comments powered by Disqus

Similar Posts

Andi Gutmans' Blog: 10 million downloads and counting...

Community News: Zend and Dojo Partnership for Ajax in the Zend Framework

Alexander Netkachev's Blog: 404 error with Zend Framework Front Controller

Content with Style: Linkedin and Zend_Oauth

Padraic Brady's Blog: Zend Framework: Surviving The Deep End, Chapter 3 - The Model Available


Community Events











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


unittest code symfony2 framework series release component hhvm application composer introduction hack facebook package opinion language threedevsandamaybe install security podcast

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