On Mon, Feb 2, 2009 at 1:47 PM, Chris Mc <[email protected]> wrote:
>
> Hi brian,
>
>> Are you getting an empty table? Or, is Cake running into an error and
>> not continuing to output anything?
>
> Yes, I'm getting an empty table, the for loop just doesn't execute at
> all, but all the other code works (even the stuff after the for)
OK, so $restaurants is empty.
>> If the former, it's likely that you haven't set a var named
>> 'restaurants'. You need $this->set('restaurants', ...); in your
>> controller action.
>
> Yes, I've been trying to do that. The controller action is a function
> defined in the controller, right ? Does it have to be called anything
> special ?
Well, kinda, if you want it to run ;-) Not knowing the details of your
app, it's difficult to say. You mentioned that this was on your
"homepage". Can you be a bit more specific about how this controller
action is being called? Are you sure that the action is being run?
Usually, the action that is run depends on the route (request being
made). How are you getting to this page? What's the URL?
> At the moment I have this code in the function:
>
> $this->set('restaurants', $this->paginate());
>
>
> but it's still not working.
Do you have a $paginate array set in this controller? What does it
look like? Have you tried using find() instead? You should always do
that before using pagination, just to be sure your associations are
set up properly and you get what you expected.
Are you even sure that you require pagination in this view? I ask
because I don't see any use of the PaginatorHelper in the view code
you posted.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---