HELP!! How I can pass an array data to index controller function? |
[eluser]Michael Wales[/eluser]
The variables that are passed to Controller methods are automatically pulled from the URI. For example: http://www.mybookstore.com/books/view/32 Could be (in code): Code: <?php My question would have to be - why are you wanting to pass an array of data to the controller function? In trying to understand your explanation you are retrieving data from a database? Why not just do that within the controller method itself (or even better, a model). For the sake of simplicity - I'll place it all in the controller for now. controllers/books.php Code: <?php views/books/list.php Code: <?php foreach ($books as $id => $book) { |
Messages In This Thread |
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 09:54 AM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 01:33 PM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 02:13 PM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 02:25 PM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 02:31 PM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 03:30 PM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 03:33 PM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 03:45 PM
HELP!! How I can pass an array data to index controller function? - by El Forum - 07-30-2007, 07:06 PM
|