Re: Models in default.thtml

2007-07-05 Thread Brian

Ah, okay. That's what I was aiming at. I'm porting a Rails app to Cake
and wasn't sure if I could use that line in the view. I probably
should have stated where that line of code was.

Thank you very much, though, for your answer.

On Jul 4, 1:36 am, francky06l [EMAIL PROTECTED] wrote:
 I am a bit confused with the model in default.thtml and the
 question. Models are not available in views, you would need the
 controller to access your model and pass the data to the view.

 On Jul 3, 6:58 pm, Brian [EMAIL PROTECTED] wrote:

  I feel like this is a very small thing I'm missing, but I haven't yet
  found a solution.

  So my problem is that I want to have a dynamic menu displayed on every
  page, based on visible instances of one of my models. However, when I
  try to do something like this:

  ?php foreach($this-Menu-findAll(null, null, $order = root DESC)
  as $menu): ?

  I get the call to a member function on a non-object error. I've told
  my AppController that it's supposed to use the Menu model (var
  $uses...) but that's not working.

  Any advice? Thanks much again.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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: Models in default.thtml

2007-07-04 Thread francky06l

I am a bit confused with the model in default.thtml and the
question. Models are not available in views, you would need the
controller to access your model and pass the data to the view.

On Jul 3, 6:58 pm, Brian [EMAIL PROTECTED] wrote:
 I feel like this is a very small thing I'm missing, but I haven't yet
 found a solution.

 So my problem is that I want to have a dynamic menu displayed on every
 page, based on visible instances of one of my models. However, when I
 try to do something like this:

 ?php foreach($this-Menu-findAll(null, null, $order = root DESC)
 as $menu): ?

 I get the call to a member function on a non-object error. I've told
 my AppController that it's supposed to use the Menu model (var
 $uses...) but that's not working.

 Any advice? Thanks much again.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---



Models in default.thtml

2007-07-03 Thread Brian

I feel like this is a very small thing I'm missing, but I haven't yet
found a solution.

So my problem is that I want to have a dynamic menu displayed on every
page, based on visible instances of one of my models. However, when I
try to do something like this:

?php foreach($this-Menu-findAll(null, null, $order = root DESC)
as $menu): ?

I get the call to a member function on a non-object error. I've told
my AppController that it's supposed to use the Menu model (var
$uses...) but that's not working.

Any advice? Thanks much again.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP 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
-~--~~~~--~~--~--~---