Odd, I'm using that very syntax and it works just fine...
$selected_users=array();
if (empty($this->data)) {
$this->data = $this->Site->read(null, $id);
/*
here you would do something like
$ali_list =
$this->Aliquot->find('all',array('conditions'=>.)). and get whatever you
need to make a list of.
*/
// below modify the references to $this->data. and
replace them with the array structure of $ali_list
foreach($this->data['User'] as $user){
if(is_array($user)){
// extract($user,EXTR_PREFIX_ALL,'user');
extract($ali_list,EXTR_PREFIX_ALL,'ali');
if($user_id !=
$this->data['Site']['admin_id']){
$selected_users[$ali_id]=$ali_username;
}
}
}
}
I use this method for building a custom list in another section of my site.
Maybe you can modify this logic to assist with this issue.
Load ('all') to get the data you need and then pass through the list and
then use $this->set(.) to send it to the view.
it's a little dirty :-(
But it should produce the desired results :-)
Best luck friend.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Tony Thomas
Sent: Thursday, January 15, 2009 4:43 PM
To: CakePHP
Subject: Re: Label information for Multiple Checkboxes
I tried that very thing, but it didn't produce the expected results.
Maybe find('list', $options) isn't meant to accommodate more than a
single field. I'm not sure.
On Jan 15, 11:34 am, "David Coleman" <[email protected]>
wrote:
> 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);
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---