bharal
bharal

Reputation: 16204

Difference between a "component" and a "plugin" in cakephp 2.1?

what is the difference between a "plugin" and a "component" in cakephp? I have some things that i thought were components - because they are loaded with the

var $components = array(...);

but now that i have upgraded to cakephp 2.1 (from 1.3) I am told that these are, in fact, "plugins" by the useless error message. Are components just another name for plugins... or something else?

Upvotes: 0

Views: 862

Answers (1)

mensch
mensch

Reputation: 4411

Components and Plugins are still separate entities in Cake 2.0. According to the manual components are "are packages of logic that are shared between controllers", whereas plugins are "a combination of controllers, models, and views". Compoments extend the base Component class, while Plugins have their own AppModel and AppController.

Think of a plugin as a separate Cake application sharing the same core libraries with your main application.

Also, in Cake 2.0 components are handled slightly different from 1.3 (they should have component in their file name, so SessionComponent.php instead of session.php, for example) and some functions were removed. The EmailComponent was deprecated entirely, for example.

The error messages you're getting might refer to third-party components. Which ones are giving you trouble?

Upvotes: 1

Related Questions