Overview of application files and directories

What is this article for?

This article should give you 'the lay of the land' on what to find in the various directories in the application's directory. It will help you get orientation on the code base.

Overview

Mind these directories are relative to the application folder. These are different for Wordpress, Joomla and Magento. See where they are in this article.

/assets

This folder contains all JS, CSS and images of the application (mind there is a separate location for customization assets).

in /assets/javascript/ you find CB's AMD modules. CB and Kenedo use require.js for AMD functionality.

in /assets/css/ you find stylesheets that CB uses. Note that in CB, views choose which stylesheets are loaded and there is a general and many view-specific stylesheets. 

in /assets/kenedo/ you find Kenedo's assets (Kenedo is the underlying framework we built CB on).

in /assets/kenedo/external/ you find 3rd party libraries that CB and Kenedo use. The jQuery plugins there are modified to work in an AMD-style architecture.

Important note: Loading of assets is designed for use in CDNs and with Far-Future-Headers. Assets are loaded with cache-busting query strings, which can be controlled in CB settings (since CB 3.1.2, see CB settings at 'Analysis and Debugging'). For Apache, there are .htaccess files in place, for nginx or others you must make settings yourself.

/controllers

This folder contains all KenedoControllers of the core system (mind there is a controller folder for custom controllers as well).

Each file represents a controller and is named via a naming convention (controller name cart is in file cart.php containing the class ConfigboxControllerCart).

See KenedoController for details on controllers.

/external

This folder contains 3rd party libraries for CB and also Kenedo (CB's framework). Kenedo uses it's own external lib folder in (/external/kenedo/external).

/helpers

This folder contains a number of static helper classes for common functionality. The bulk of functionality is handled in models, in /helpers you find classes for functions that are more practical for use as static classes.

/language

Contains .ini files for localization of system texts. There is also a folder and file for overrides. See Custom Wording and Translations for details on localization and custom wording.

/models

Contains all KenedoModels of the core system. There is also a directory for custom models. 

Models have a name and file name and class name derive from it. E.g. Model cart is in the file cart.php and the model class is ConfigboxModelCart.

To get a model instance you call KenedoModel::getModel($modelClassName). Mind that model objects are returned with via singleton pattern. 

See details on KenedoModels in the article KenedoModel.

/observers

ConfigBox uses the Observer Pattern for appending and manipulating common data during various events. There is also a folder for custom observers, which are called 'Connectors'. See the article on Custom Connectors.

/psp_connectors

This folder is home to all PSP (payment service provider) integrations. 

/views

This folder contains all KenedoViews of the core code. KenedoViews handle data fetching from KenedoModels and preparation for output in templates. They decide which stylesheets must be loaded and which JS AMD modules get loaded and which module's function to be called.

Naming convention: Views have a name, subfolder and PHP class name derive from it. E.g. 'cart' has subfolder 'cart' and PHP class name is 'ConfigboxViewCart'.

Instances of a KenedoView are returned by KenedoView::getView($viewClassName). Since CB 3.1.2 you get regular instances (no longer via singleton pattern).

See the comprehensive article on KenedoView.

 

Customization dir

This folder holds the entirety of customization files for CB. The location of that directory depends on the platform (Joomla/Wordpress/Magento). See Filesystem directories for ConfigBox . The following paths are relative to the customization directory.

In your customization code, you can get the path to this location with this method.

$path = KenedoPlatform::p()->getDirCustomization();

The following headlines are all about directories in the customization folder.

/assets

As the core code's assets folder, this folder holds stylesheets, images and JS AMD modules of your customizations.

In your customization code, you can use this function to get URL and filesystem path to this folder

$url = KenedoPlatform::p()->getUrlCustomizationAssets(); $path = KenedoPlatform::p()->getDirCustomizationAssets();

See articles on Custom CSS styling and Custom JavaScript for adding your own stylesheets and JavaScript files. For JS, we recommend using AMD JS Modules in KenedoViews .

/calc_term_types/

This is the location for custom calculation terms. This is an experimental feature and bound to potential removal or breaking changes. The feature aims to enable custom calculation logic in the calculation formula editor. Rovexo is in the process of collecting implementation experience in customization projects before finalising API specs and will fully document this feature.

/controllers

This is the location for custom KenedoControllers. They work exactly the same as built-in controllers. See above and in article KenedoController.

Developers must ensure that no naming collisions occur. We recommend using prefixes to your controller names.

/custom_observers

This is the location for custom observers (called 'Custom Connectors' in user interfaces). Compare with built-in observers and in article Custom Connectors. 

/language_overrides

Here you place overrides to the localized wording of CB system texts and add localization of your customization's text output. See infos on core folder /language and the article on Custom Wording and Translations.

/model_property_customization

In this location you can place PHP files that modify properties of built-in KenedoModels. This is an experimental feature and bound to potential removal or breaking changes. The feature aims to enable developers to add or modify CB data like products, pages, questions, answers and so on. Rovexo is in the process of collecting implementation experience in customization projects before finalising API specs and will fully document this feature.

/models

Here you place custom KenedoModels. They work exactly like built-in models, getting instances works the same as well - KenedoModel::getModel($modelClassName). Developers must ensure that no naming collisions occur. We recommend using prefixes to your model names.

See above on the built-in models folder and the article on KenedoModel.

/views

Here you add custom KenedoViews. See details in the article on KenedoView.

Â