Page 1 of 1

How can i get data from another controller, preventing using twice same scripts?

Posted: Thu May 03, 2018 12:37 am
by xinxilas
Hello friends

How can i get data from another, preventing using twice same scripts?

For example, im making a simple module which needs to get some datas from category
In this case: Category Description, and total products...

It would be inside content(to add at some layout on left/right columns)
So probably at this time, before run the module, controller/prodcut/category.php has already run.

How can i get (for example)

Code: Select all

$data['description']
$data['product_total']
Directly from controller/prodcut/category.php

To run {{ product_total }} at my extension twig file?

Re: How can i get data from another controller, preventing using twice same scripts?

Posted: Mon May 07, 2018 3:57 am
by OSWorX
Simply call like:

Code: Select all

$data['product_total'] = $this->load->controller( 'controller/prodcut/category/FUNCTION_HERE' );
Where it could be that, you have to hand over an array to this function - if this function require one.