Take the 2-minute tour ×

I'm creating a behaviour that needs to log the current model name. How can I get the current model name from within a controller in CakePHP?

share|improve this question
What do you mean by “current” model name? Why are you mentioning the controller if it’s a model behavior you’re creating? –  Martin Bean Aug 30 '13 at 9:28

1 Answer 1

Your architecture is flawed when you want to get a controllers primary model name from a behavior. That's a violation of the MVC pattern. Your app should have fat models and skinny controllers.

Your Behavior already has the model instance as it is required to be passed to behaviors. You can get the name from the model object:


or it's alias

share|improve this answer

Your Answer


