Answer the question
In order to leave comments, you need to log in
Where is the load.php file?
Where is the load.php Opencart 2.0 controller file? By which $this->load->language $this->load->model $this->load->controller
is called And I also can’t understand how the data is selected using the
$this->language->get() method
$ this->config->get()
$this->request->get()
Answer the question
In order to leave comments, you need to log in
The loader ($this->load) is described in the Loader class, located in /upload/system/engine/loader.php
$this->config - This is an instance of the Config class, into which data from the database is loaded (settings table).
$this->request - an instance of the Request class, located in /upload/system/library/request.php
Description of the Language class can also be found in the folder /upload/system/library/
More details about the config.
The config.php file in the "catalog" and "admin" folders is not directly related to the class instance of the Config class, which is available via $this->config in various parts of the system.
Initially, data is loaded into it from the file upload/system/config/default.php
Next, data from the application config is loaded into it. The default is upload/system/config/catalog.php , but you can override this in the "catalog/config.php" and "admin/config.php" files.
This logic is described in the file upload/system/framework.php .
Further (I don’t know exactly how), data from the settings table is also loaded into the config.
Since you are accessing through $this, it means that you are in a file of some class. If this class itself does not have such a property, then there are two options. First, your class is inherited from some other class. Look for this class - either in the same folder, or look at the beginning of the file for what you have written in use. Check classes up the inheritance chain - look for this property. If not found, then look for the __get() method of the class along the inheritance chain.
Class autoloading can also be configured - then you need to look for classes used in use, taking it into account.
Well, or put some IDE for php - it should show you where this property is set by ctrl+click on ->load.
$this->load->language
it's not a chain of files, it's an object and a chain of its methods. And the load method seems to be in the same file where you got this piece of code from, since $this
this is the current class. Perhaps the method is not in it, but in the class from which it is inherited.
To understand what and how, read about OOP.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question