You're code is not valid... i find it hard to believe it's working in
the index page even.
I recommend you either:
generate your menu in app_controller.php (in the app root folder) in
the beforeRender() method
generate your menu in a special action called makeMenu() and then
requestAction it.
==psuedocode==
..controller {
function makeMenu() {
$this->set('menudata',$this->MenuModel->findAll());
}
}
..default.thtml {
$menuhtml = $this->requestAction('/controller/
makeMenu',array('return'));
echo $menuhtml;
}
were you to go with this approach - I'd suggest some server side
caching.
thanks,
-alan-
On Aug 16, 1:09 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> hello friends,
>
> Is someone here who can solve my problem pls.
>
> Thanks
>
> On Aug 15, 5:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > hi,
>
> > This is my controller :-
>
> > <?PHP
> > class MenusController extends AppController
> > {
> > var $uses=array('Category');
>
> > function index()
> > {
> > $maincatmenu=$this->set($this->Category->findAll());}
>
> > ?>
>
> > Below is my model ("menu.php") :-
>
> > <?PHP
> > class Menu extends AppModel
> > {
>
> > }
>
> > ?>
>
> > below is my view file ("index.thtml") :-
>
> > <?PHP
> > for($j=0;$j<sizeof($maincatmenu);$j++)
> > {
> > <tr><Td>echo
> > $maincatmenu['Category']['name']</Td></tr>
> > }
>
> > ?>
>
> > i am using an element that is renders in the default.thtml and below i
> > am trying to have menus data in that element like this :-
>
> > $this->requestAction('/menus/index');
>
> > but not able to get this. But when i try to access directly menus than
> > it works (http://mysite.com/menus/) in other it does not (http://
> > mysite.com/categories)
>
> > Pls help.
>
> > On Aug 15, 12:07 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Thanks Chris,
>
> > > I will review my code and will let u know if i got something to ask.
>
> > > Thanks again !!!
>
> > > On Aug 14, 11:53 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > > > On 8/14/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > > > Thanks Chris,
> > > > > can we use requestAction() in the default.thtml ? and how ?
>
> > > > > if we use something like this view->controller->requestAction() as i
> > > > > found this in one of the article in the bakery.
>
> > > > > then what "Controller" means here.
>
> > > >http://groups.google.com/group/cake-php/browse_thread/thread/3563ab54...
>
> > > > --
> > > > Chris Hartjes
> > > > Senior Developer
> > > > Cake Development Corporation
>
> > > > My motto for 2007: "Just build it, damnit!"
>
> > > > @TheBallpark -http://www.littlehart.net/attheballpark
> > > > @TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---