In my BooksController I put:

$this->set('data',$this->Book->Author->findAll());

Because I want to populate a selectbox in add.thtml with all authors.
Now I end up with a rather complex array, print_r($data) gives me:

Authors
Array
(
    [0] => Array
        (
            [Author] => Array
                (
                    [id] => 1
                    [name] => John

                )

        )

    [1] => Array
        (
            [Author] => Array
                (
                    [id] => 2
                    [name] => Pete

                )

        )

    [2] => Array
        (
            [Author] => Array
                (
                    [id] => 3
                    [name] => Marlon

                )

        )

How do I use this array with selectTag?


--~--~---------~--~----~------------~-------~--~----~
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