I have recently started looking into development on the Opencart PHP eCommerce framework. I am having trouble understanding how OpenCart calls $this->config->get().
For instance in my header.php file (in the controller) where I call for the website logo it will check if the file exists and then call
$this->data['logo'] = $server . $this->config->get('config_logo');
I’m not quite sure how it is using this code to fetch the image and where it is going to get the data. Let me know in the comments if you want any more information.
Let’s break it down…
$thisis the controller. ‘$this’ is a PHP reference to the object you are currently inside.datais an array (instance variable of the controller), of which['logo']is a key.$serverprovides the first part of the path to the file.configis an object instantiated in the controller.getis a method ofconfig, andconfig_logois what is being sought.By following the code from the controller, and looking at what
includesare being called, you should be able to work your way through the object hierarchy and look at the actual method code. From that, you can figure out what is actually happening.I can only make assumptions as to how or where the configuration data is stored, but
config‘sgetmethod will contain the code that actually pulls that data.Finally, here is the OpenCart Documentation – Quick Start for Beginners