Hey guys!
I'm trying to load a controller inside another controller.
$data['com_top_menu'] = $this->load->controller('account/com_top_menu');
However, this seems to not work when I'm trying to load a controller that is located in the same folder as the controller I'm loading it from.
Tried loading controllers from other folders and seem to not load as well. It seams to load only from the common folder.
Could this be some bug?
I think your code are wrong. For me is working. I add search controller inside header controller in admin and is working fine.
Why do you think so? I guess that using $this->load->controller('path/controller') is the way to load it. There not much where to the wrong here, it is just a simple line of code.daniGo wrote:I think your code are wrong.
Can you try for example, to load the controller information/contact into account/account?
in /catalog/controller/account/account.php add:
Code: Select all
$data['contact'] = $this->load->controller('information/contact');
Code: Select all
<?php echo $contact; ?>
Actually it seems that the controller is loading.
If I place an echo in the middle of the loaded controller it will show the output on top of the page before the template rendered. So, it looks like the controller is loaded and just doesn't output anything through the rendered view, unless it is a controller inside the common folder.
Files are all in place, controller loads, it just doesn't output anything through the view.
If I place an echo in the middle of the loaded controller it will show the output on top of the page before the template rendered. So, it looks like the controller is loaded and just doesn't output anything through the rendered view, unless it is a controller inside the common folder.
Files are all in place, controller loads, it just doesn't output anything through the view.
The diference is here:
Code: Select all
$this->response->setOutput($this->load->view('default/template/account/account.tpl', $data));
Code: Select all
return $this->load->view('default/template/common/search.tpl', $data);
Who is online
Users browsing this forum: No registered users and 9 guests