All controllers in OpenCart share a common ancestor, the Controller class, located in the DIR_APPLICATION/system/engine/controller.php file. Note that DIR_APPLICATION is the path to your application directory, and is defined in the OpenCart config.php file.
In object oriented terms, the Controller class is called a base class. It contains common methods and data definitions [...]
Entries Tagged as 'opencart'
The OpenCart Controller base class
November 15th, 2009 · No Comments · article, news, opencart
Tags:
OpenCart Top Level Controller Architecture
November 14th, 2009 · No Comments · article, news, opencart
An OpenCart top level controller is responsible for orchestrating the complete construction of an OpenCart page.
As an example, the ControllerCheckoutCart controller class is responsible for coordinating the model data and the template view necessary to create a checkout cart page for the client.
Another example is the ControllerCommonHome controller class, which is responsible for the main [...]
Tags:
How OpenCart Renders Pages
November 14th, 2009 · No Comments · article, news, opencart
The OpenCart Controller class contains a render method that is used to produce HTML pages output by all OpenCart classes that inherit from Controller class.
Here is how it works.
Each time a page is rendered, it is done with one top level controller. The top level controller may contain zero or more child controllers and [...]
Tags:
The OpenCart Router Class
November 13th, 2009 · 1 Comment · news, opencart
The OpenCart Router class takes a route string and converts it to an internal representation of a class and a method, typically for invoking a controller.
The Router class is specialized to the directory structure of OpenCart and the naming conventions for OpenCart controller files and class; therefore, before discussing the Router class in detail, it [...]
Tags:
The OpenCart Response Class
November 13th, 2009 · No Comments · news, opencart
The OpenCart Response class has a simple job. It outputs a page of HTML to a client browser.
But it does a few other things related to that function as well, including the following:
It compresses output data in accordance with how the OpenCart installation is configured and the client browser capabilitiles.
It maintains an array of header [...]
Tags:
The Open Cart “load” Class Variable and Magic Methods
November 13th, 2009 · No Comments · news, opencart
All controllers in the OpenCart ecommerce package inherit from the Controller class.
The load variable in those controllers was a bit of a mystery to me, because I could not figure out where it was assigned. Then I realized it was being accessed through the Registry class using a PHP language construct called a “magic [...]
Tags: