1.  Add these to app/config/bootstrap.php

2. It's up to you.  I expect most people will use a helper like that,
if they do not need the location to be linked between objects (where
you would want them in the database).  If you have your "countries"
table, you can get a list suitable for a select with $this->Country-
>generateList()

2a. You can manually cache anything -> 
http://bakery.cakephp.org/articles/view/249

3. generateList is what you want.  The default behaviour is to extract
the id as key, and name as value (exactly what you are doing), but you
can change this to whatever you like.  Eg if you wanted a list of
client id to client address, you could have
$list = $this->Client->generateList(null, null, null, '{n}.Client.id',
'{n}.Client.address')

This is obviously in your controller.  If for whatever reason you
really need the list generated in the view, then you can do it with
Set::extract.
$client_ids = Set::extract( $clients, '{n}.Client.id' );
$client_names = Set::extract( $clients, '{n}.Client.name' );
$list = array_combine( $client_ids, $client_names );



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to