Zend Framework

Nov
16th
09

Requiring a checkbox to be ticked in ZendFramework

Zend Framework “documentation” dosn’t say much about validating single checkboxes. If you need to do this, say for a terms ang conditions agreement or something, you have to check that the value is greaterthan zero.

To do this, add a validator like this:

 $e =new Zend_Form_Element_Checkbox('tnc');
$e->addValidator('GreaterThan', false, array(0));

And validate your form in the controller as usual

 if ($form->isValid($request->getPost())) {

Thanks to Rob Knight for adding how to do this in the bug tracker. http://framework.zend.com/issues/browse/ZF-5920


Oct
1st
09

PaulaBrusky.com

PaulaBrusky.comPaula Brusky is a bassoonist, teacher, and researcher. She recently finished a PhD in Bassoon Performance at the Sydney Conservatorium of Music, University of Sydney.

When she asked aSecondSystem to build her a web site, it was obvious only a bespoke site, with extensive CMS capabilities would do. Paula is a perfectionist, who knew she needed to be able to keep her copy fresh and accurate. The site also allows for image and media management bringing Paula’s music to your browser with all the background information presented.

The site CMS was built using Zend Framework providing page editing with a WYSIWYG editor, media management, order-able hierarchical drag-and-drop menu management and a template system. JQuery provides the drop down menus smooth transitions & the dynamic gallery. The flash MP3 player provides a nice simple audio player inserted right into the copy within the WYSIWYG editor.

Check the site out.


Jul
28th
09

Multiple Forms on a page in Zend Framework

Zend Framework generally avoids telling you how to do things, prefering to give ways to achiving what you want, but avoiding making reccomendations. That can be a weakness as well as a strength.

If two forms are on one page, submitting to the same action that rendered the page, both will try and validate which looks a bit odd from user point of view and could potentialy cause application problems.

To avoid this, I decided to have each form submit to it’s own action. This kept the main page rendering action nice and neat, separating the other logic out nicely.
(more…)


Jul
1st
09

Strip require_once from Zend Framework

Zend Framework has require_once statements throughout the library. These are not needed if using the auto loader that most Zend Framework applications use and have a significant negative performance effect. To strip these statements out of all the files except the/Loader/Autoloader.php file a command line statement is required.
(more…)


Jun
30th
09

Bundabergrum.com.au

bundy This iconic Australian brand have remodelled their website as an interactive web 2.0 application. It allows users to participate by adding and suggesting events, uploading pictures, search for upcoming events and vote on promo videos.

bundabergrum.com.au has been built using the zend php framwork, with jquery integration and a standards compliant accesible xhtml and css front end.

Working with a team of technical specialists on this national brand website as a senior developr was an exciting challenge and a great oportunity to research and develop cutting edge development techniques.