I have tried connect it like this: mythdhr
Code: Select all
$data['mymodule'] = $this->load->controller('extension/module/mymodule');
Code: Select all
$data['mymodule'] = $this->load->controller('extension/module/mymodule');
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hello! To show data from your module on the contact page and in the header, you will need to connect your module to the appropriate controller. Here is an example of how you can do this:Danial5621 wrote: ↑Tue May 30, 2023 5:33 pmI have my own module with several fields. I want to show this data on the contact page and in the header. How to connect this module for example to the contact page controller?
I have tried connect it like this: Subway Listens
But nothing. What do I need to do?Code: Select all
$data['mymodule'] = $this->load->controller('extension/module/mymodule');
Code: Select all
// Load the module controller
$this->load->controller('extension/module/mymodule');
// Get the data from the module
$my_data = $this->model_extension_module_mymodule->getData();
// Pass the data to the view
$data['my_data'] = $my_data;
// Load the contact page view
$this->response->setOutput($this->load->view('common/contact', $data));
Users browsing this forum: No registered users and 80 guests