So I'm going to be using CakePHP for an upcoming project. I have been researching the ways that an hMVC structure could be applied to the Cake framework. This is a large project so I believe hMCV would add some value. Regarding applying hMVC to cake, it seems that it would be possible to create my own hMVC setup using plugins as separate modules of MVC to achieve an hMVC setup.

It this sensible? It this the way that hMVC should be approached in CakePHP? Is there another way that I should be approaching this, that I have overlooked in my research?

Additionally, would I be able to have these plugin classes extend my main app classes if needed. Could I create something like security_controller which I could then have maybe only 3 of my 5 plugins inherit (ie the respective controllers in each would inherit from the security_controller)? I'm still confused regading the interaction between a plugin and the main app. Please let me know if any further clarification is needed and thank you for your help.

Edit: it looks as though hMVC might be unnecessary here, and that I would be able to define the global functionality I need in AppModel.php and AppController.php respectively. I'm still interested in the community's opinion on what is the best way to achieve the type of functionality I talk about in my question. Thanks again.

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
If this question can be reworded to fit the rules in the help center, please edit the question.

Yeah, I did see that one, I just wanted to know if maybe someone went further with this. The answer on that page wasn't super useful, so I wanted to see what other info could be gathered. Thanks though.
–
usumoioFeb 13 '13 at 18:27

2

favour composition over inheritance - which in context means using components, behaviors, and (5.4) traits and not inheritance to define what classes can do. You can only define one inheritance tree (be conventional - see the book if in doubt) but you can make any class have any particular functionality without duplicating code or creating complexity with intelligent usage of the aforementioned classes/constructs.
–
AD7sixFeb 13 '13 at 22:51