Re: Shared code for Models but not in AppModel
Thanks man. I dont actually expect magic. Although Cake does do some
things magically, I am never sure where the magic ends and my
ignorance begins. In all my searching I never actually found a
document that stated what you did. I realized that I could load the
classes but was not sure if I was somehow stepping around the
framework. I always try to do things in the Cake way if at all
possible.
On Dec 7, 9:22 am, AD7six <andydawso...@gmail.com> wrote:
> On Dec 7, 3:11 pm, RhythmicDevil <rhythmicde...@gmail.com> wrote:
>
> > No actually. I created the file and class structure as shown above. I
> > get an error from PHP saying class not found. So unless I have to add
> > includes or requires to my files Cake does not load the classes.
>
> well, yes. since Cake is just php, and that's how php works.
>
>
>
> > So Cake handles this just fine:
>
> > AppModel->SubClass
> > AppMode->AnotherSubClass
>
> It handles that case automatically.
>
>
>
> > But not this
>
> > AppModel->SubClass->AnotherSubClass
>
> It does not handle that case automatically - it does however handle it
> 'fine'.
>
>
>
> > If I am wrong about this please tell me where I am going wrong. Please
> > see my example above.
>
> CakePHP isn't magic. It does somethings for you "automagically". If
> you're using 1.3 you must load the classes before you use them, if
> you're using 2.0 you must declare you are going to use them before
> using them.
>
> the only thing cake does for you (in 1.3) is automatically load App
> classes for you. In 2.0 it doesn't do that any more seehttps://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/AppMode...
> But you aren't talking about App classes - you're talking about some
> other classes, and you need to load/use the classes before you can
> reference them.
>
> AD
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home