News Feed
Sections




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

Tim Koschuetzki's Blog:
How to put Combined Fields Into CakePHP's Model->generateList()
August 10, 2007 @ 09:36:00

Tim Koschuetzki has posted this tutorial today about how to create form fields with combined information from more than one database column.

Two days ago, someone on #cakephp had the problem of getting combined values out of the Model->generateList() function in CakePHP. I advised him on doing some Set::extract() things, which at the end of the day got rather complicated. As a result, I was conscience-stricken. Here is a much more elegant solution I could come up with.

He introduces the generateList function first, showing how to use it to create a simple select list in your form. Unfortunately, it only understands using one field at a time, so he worked around it, creating a solution - his myGenerateList function - that handles things similarly and returns the same kinds of results (so it can be used with the set() function as well).

0 comments voice your opinion now!
combined field data database cakephp framework generatelist combined field data database cakephp framework generatelist


blog comments powered by Disqus

Similar Posts

Gopal Vijayaraghavan's Blog: PHP Noodle Soup!

Leonid Mamchenkov's Blog: Disable and enable CakePHP plugins on the fly

HowTo Forge: Installing The PHP-MSSQL Module On CentOS 5.0

Dave Marshall's Blog: Landing a PHP job Part 1: Technical Knowledge and Skills

PHP Town Hall Podcast: Episode 4: PHP's Vision, Beards, and Cake


Community Events





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


voicesoftheelephpant podcast conference release security series language list composer framework version laravel symfony tool interview introduction library community opinion artisanfiles

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