Designing frontend application you could need to extend BEdita with components, models or helpers to use in backend and frontend apps too. To not mess BEdita core with not core items you should use the addons folder. Addons is a place where CakePHP will search for models, components, helpers and vendors. It's a conventional folder where you can put no core classes.
The addons folder that you can find in bedita root folder presents some directories that are automatically added to CakePHP paths to retrieve the relative classes.
addons |--components |--config |--helpers |--models |--vendors
For Example CakePHP will search components in bedita/bedita-app/controllers/components and in bedita/addons/components and so on for models, helpers and vendors.
Adding new BEdita object type
If you need a new BEdita object type that not require a new BEdita module you should put your Model in addons/models folder then you'll have to enable the object type to be written in configuration and so to be used correctly in any part of BEdita. To do it go in administration module and click on addons in the left menu. There you can enable/disable BEdita object type and see a complete list of all addons available on the system.
If you want manage your new BEdita object type in a module already present, add to your model the attribute $module
. For example if you have created a Place model and you want to see it in Addressbook module, write in you model class:
public $module = "addressbook";
according with field "name" in table "modules". Then enable your addon.
In config folder you can create a config.php file and put in some global configurations that you'll have available in BEdita. For example when you add a new BEdita object you could need a free semantic relations that involve it with other BEdita objects. Write your configuration like an array named $config
.
Note that disabling a BEdita object addon all objects belonging to it will be deleted, but you will have to edit config.php if you want to remove any configuration related to that model.
For more information about BEdita objects see the "BEdita objects" articles.