Thursday, September 29, 2011

Plugin Models with CakePHP

I don't do plugin development with CakePHP much.  But here's a tip for young players.

When defining relationships in a plugin model, remember to include the plugin name in the className parameter, even if it's for a model in the same plugin.

Personally, I think you should only need to do this if you are using referencing a model in another plugin or in the main app. i.e. 'className' => 'App.CoreModel'.  This would make transitioning an app to a plugin, or visa versa not require much maintenance.

No comments:

Post a Comment