if the UserController extends AppController then (essentially) when you create an instance of the UserController class it contains all the members of the AppController Class as well as what's defined in UserController. They're created effectively as a single object.

So, by putting something in UserController - you're giving it access to AppController's stuff, too.

So something in UserController will be able to access AppController - and then it will be able to get stuff from UserController. But you won't be able to put something in AppController which asks for something that UserController owns and then expect an instance of AppController to be able to get it to work.

If you have an Animal Class and your Dog Class extends Animal then your dog will have all the functionality of an Animal - but your Animal Class won't necessarily know how to bark!

Does that make sense!?

On 10/17/06, brandags <[EMAIL PROTECTED]> wrote:

Alright. That makes sense.
But since the Users controller extends the App controller, if I go to a
page like:
/users/add
Shouldn't that be creating a User object rather than an App object? So
that when the beforeFilter runs, it's running through the User object?
For example, if I put the beforeFilter in the userController, it
understands it. And I can call a function in the App controller which
can THEN reference variables in the User controller just fine. But it
seems that the beforeFilter runs BEFORE the User controller is created,
as if the App controller runs on its own before it's run as an
"extension" of the Users controller. Am I making sense?

When does the beforeFilter run when calling /users/add? And if I have a
beforeFilter in both my Users and App controllers, in what order are
they run?



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

Reply via email to