Re: Trying to map findAll to $form->select()

2008-07-16 Thread Igor

> find('list')

Works like magic! Thank you Chris!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Trying to map findAll to $form->select()

2008-07-15 Thread Chris Hartjes

On Tue, Jul 15, 2008 at 10:39 AM, Igor <[EMAIL PROTECTED]> wrote:
> Is it possible to map this array in such a way so the output looks
> something like the example below? Or is it a matter of passing right
> query to findAll() to produce a asimpler array?
>
> 
>  Stage 2
>  Stage 3
> 
>

$this->Stage->find('list') should generate an array that you can pass
to form->select()


-- 
Chris Hartjes
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Trying to map findAll to $form->select()

2008-07-15 Thread Igor

Could anyone point me in the right direction with this one please?

I'm trying to pass some values to my view...

$stages = $this->Stage->findAll(
  null, array('id', 'name'), null, null
);
$this->set('stages', $stages);

... this is what's being passed...

Array
(
[0] => Array
(
[Stage] => Array
(
[id] => 2
[name] => Stage 2
)
)

[1] => Array
(
[Stage] => Array
(
[id] => 3
[name] => Stage 3
)
)

)

Unfortunately $form->select('stageID', $stages, null, array(),
'Stage'); outputs some strangeness.

Is it possible to map this array in such a way so the output looks
something like the example below? Or is it a matter of passing right
query to findAll() to produce a asimpler array?


  Stage 2
  Stage 3


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---