I created my own loadModel method as part of my controller using the
path
$path = APP . 'controllers' . DS . 'components' .DS . 'models' . DS;

So, now the models are found but I get these errors
Warning: overload() was unable to locate class 'model1' :
Fatal error: Cannot instantiate non-existent class: model1

Is this just not a Cake way of doing things (Components with Models)?
I checked out ACL (which I'm now kind of using as a guide) because it
is a component with models but I'm still getting "Cannot instantiate
non-existent class: model1" errors.

Any guidance sure would be appreciated.

Thanks,
Shawn

On Aug 9, 11:58 am, starkey <[EMAIL PROTECTED]> wrote:
> I changed the name to TesterComponent and still no good.
>
> Thanks!
>
> On Aug 9, 11:56 am, starkey <[EMAIL PROTECTED]> wrote:
>
> > Hello!  I'm using Cake 1.1 and I'm trying to create a component that
> > accesses the database.
>
> > Here is what I have:
> > /cake
> >   /app
> >    /controllers
> >      /components
> >       tester.php
> >       /models
> >        model1.php
> >        model2.php
>
> > class Tester extends Object {
> >    var $controller = true;
> >    var $Model1;
> >    var $Model2;
>
> >    function startup(&$controller)
> >    {
> >       loadModel('Model1');
> >       $this->Model1 = & new Model1();
> >       loadModel('Model2');
> >       $this->Model2 = & new Model2();
> >   }
>
> >   function getModel1Rows()
> >   {
> >     return $this->Model1->findAll();
> >   }
>
> > }
>
> > However, I keep getting this error:
> > Cannot instantiate non-existent class: model1
>
> > Thanks for any help!
> > Shawn


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to