Loading...

Precontrollers and Postcontrollers

We no longer maintain the Knowledge Base since version 4.3.x. All the latest user and developer documentation for 4.3.x and newer versions is now available at docs.cs-cart.com.

  • This article applies to CS-Cart versions:
  • 3.0.x

Precontrollers and postcontrollers are special PHP files of the addon, which (depending on their names and location in the file structure of the addon) are called before or after executing one or another standard controller.

Example:

  • The addon Attachments has the file /addons/attachments/controllers/products.post.php in its structure. The directory controllers indicates that the files in this directory are either controllers of the addon or precont/postcont for standard controllers.
  • The first part of the file name "products" defines the controller name. As a controller with the name "products" is a standard one, the addon can only declare precont or postcont for it.
  • ".post" in the file name indicates that the file will be connected and executed after the standard controller "products" is performed. To set it in motion prior to the standard controller execution, ".post" should be changed to ".pre".
<< Read previous Read next >>
Home / Docs / General Methodology / Controllers / Precontrollers and Postcontrollers