Re: Accessing models from outside their main controller

2008-04-20 Thread David Coll
Which version of cake are you using ? 2008/4/21, Smelly_Eddie <[EMAIL PROTECTED]>: > > > I tried that, I get; > Fatal error: Class 'App' not found in /srv/www/htdocs/cake/app/ > controllers/components/tickets.php on line 3 > > What does that mean? > > > > On Apr 20, 9:01 am, Sliv <[EMAIL PROTECTED

Re: Accessing models from outside their main controller

2008-04-20 Thread Smelly_Eddie
I tried that, I get; Fatal error: Class 'App' not found in /srv/www/htdocs/cake/app/ controllers/components/tickets.php on line 3 What does that mean? On Apr 20, 9:01 am, Sliv <[EMAIL PROTECTED]> wrote: > Components do not load models automatically, you have to manually load > them with: > > c

Re: Accessing models from outside their main controller

2008-04-20 Thread b logica
There's no such var in a component, though, so declaring it wouldn't have any effect. On Sun, Apr 20, 2008 at 10:43 PM, Daddy Cool <[EMAIL PROTECTED]> wrote: > > Wouldn't it be also possible to use the controllers method ? > > ==> var $uses = array('model1','model2'); > > > --~--~-~--

Re: Accessing models from outside their main controller

2008-04-20 Thread Daddy Cool
Wouldn't it be also possible to use the controllers method ? ==> var $uses = array('model1','model2'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@go

Re: Accessing models from outside their main controller

2008-04-20 Thread Sliv
Components do not load models automatically, you have to manually load them with: component: function startup(&controller) { App::import('Model', 'ModelName'); $MyModel = new ModelName; } > I just started working with CakePHP today, and I was wondering how to > access a model from within a comp

Accessing models from outside their main controller

2008-04-20 Thread Opblah
I just started working with CakePHP today, and I was wondering how to access a model from within a component. MVC Class Access Within Components (http://book.cakephp.org/view/65/ mvc-class-access-within-compon) talks about how to get access to the current controller, but if I'm using the componen