You could also do something like this in your controller:
$aliquots = $this->Aliquot->find(
'list',
array(
'fields'=>array(
'Aliquot.id',
'Aliquot.name'
),
'conditions'=>array(
// some conditions if necessary.
)
)
);
And then pass this to your view with
$this->set(‘aliquotes’, $aliquots);
<http://www.connaxis.com/> <http://www.connaxis.com/>
<http://www.connaxis.com/> <http://www.connaxis.com/>
<http://www.connaxis.com/> <http://www.connaxis.com/> David Kenneth Coleman
Software Developer
…………………………………………………………………………………………………………………
United States: +
1 6468108783 Dept: Development
Argentina:
+ 54 11 52465987 E-mail: <mailto:[email protected]>
[email protected]
The Netherlands: + 31
208080017 Skype: david.k.coleman
¡ <http://www.connaxis.com/> <http://www.connaxis.com/>
<http://www.connaxis.com/> <http://www.connaxis.com/>
<http://www.connaxis.com/> <http://www.connaxis.com/> NEW! Please check out
our new <http://www.creative-outsourcing.com/> Portfolio Website:
<http://www.creative-outsourcing.com/> Connaxis Creative Outsourcing
Specialist <http://www.creative-outsourcing.com/>
www.creative-outsourcing.com
First page position Google.com:
<http://www.google.com/search?hl=en&q=creative+outsourcing&btnG=Google+Searc
h> Creative Outsourcing
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Tony Thomas
Sent: Thursday, January 15, 2009 2:48 PM
To: CakePHP
Subject: Label information for Multiple Checkboxes
I'm building a list of checkboxes like so:
echo $form->input('Aliquot.id', array( 'label' => FALSE,
'type' =>
'select',
'multiple' =>
'checkbox',
'options' =>
$aliquots));
echo $form->input('box_id', array('options' => $boxes));
$aliquots above is built from $this->Aliquot->find('list', $options);
which finds all the ids of the pertinent records. The problem I have
this this only generates a list of ids. Is there good way to load an
array for 'label' so that I can display more than just the list of ids?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---
<<inline: image001.jpg>>
