Difference between "component" and "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 were loaded with

var $components = array(...); 

but now that I have upgraded to cakephp 2.1 (from 1.3), I was told that these are, in fact, β€œplugins” with a useless error message. Are components just another name for plugins ... or something else?

0
source share
1 answer

Components and plugins are still separate objects in Cake 2.0. According to the manual, components are β€œlogic packages that are shared between controllers,” while plugins are β€œa combination of controllers, models, and views.” Components extend the base class Component, while plugins have their own AppModel and AppController.

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

In addition, in Cake 2.0, components are handled a little differently from 1.3 (they must have a component in the file name, so SessionComponent.php instead of session.php , for example), and some functions have been removed. For example, EmailComponent completely out of date.

The error messages you receive may relate to third-party components. Which of them do you dislike?

+1
source

Source: https://habr.com/ru/post/912457/


All Articles