Re: Using models in app controller for default.thtml ???

2007-07-30 Thread Geoff Ford
If you need the component in your default layout put it in the app_controller.php Helpers are for pure presentation logic, such as looping an array and creating a tree. A component is used whenever there may be business logic, such as if this is the main cat then these are the subcats. You proba

Re: Using models in app controller for default.thtml ???

2007-07-30 Thread [EMAIL PROTECTED]
Thanks Ford, should i add var $components = array("MyComponent"); in the app_controller.php ? Also instead of creating component what u think of creating an helper ? I think it can be used as component ? Please let me know. Thanks On Jul 30, 4:58 pm, "Geoff Ford" <[EMAIL PROTECTED]> wrote: >

Re: Using models in app controller for default.thtml ???

2007-07-30 Thread Geoff Ford
Components are loaded with var $components = array("MyComponent"); and used similar to models i.e. $this->MyComponent->function(); See http://manual.cakephp.org/chapter/components for more details. Geoff On 7/30/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Thanks for you replies friend

Re: Using models in app controller for default.thtml ???

2007-07-30 Thread [EMAIL PROTECTED]
Thanks for you replies friends, i am new to cakephp can you tell me how can i load component in it. Also stil i have develop an component but i will try and create it and let u know. but pls tell me how can i load a compnent and how can i include it in the default.thtml. Thanks On Jul 30, 7:26

Re: Using models in app controller for default.thtml ???

2007-07-29 Thread Tulio Faria
Or you can try create a component, and load it with loadComponent or anything else. I think it's better... On 29 jul, 21:54, Geoff Ford <[EMAIL PROTECTED]> wrote: > I believe $uses is overwritten by the actual controller that is > invoked. I suggest you use loadModel() and creat your own instanc

Re: Using models in app controller for default.thtml ???

2007-07-29 Thread Geoff Ford
I believe $uses is overwritten by the actual controller that is invoked. I suggest you use loadModel() and creat your own instances of the models you need. Geoff -- http://lemoncake.wordpress.com On Jul 29, 8:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello Friends, > > I am new to

Using models in app controller for default.thtml ???

2007-07-29 Thread [EMAIL PROTECTED]
Hello Friends, I am new to Cakephp. I am having an problem in it. The scenario is :- i have categories and subcategories. i want to show them as menus so i put them in the default.thtml file. To extract them from the database i have used var $uses =array('Category',Subcategory) in app_controll