Reputation: 209
I have created one controller inside catalog/controller/module/same_collection.php
Inside that :
class ControllerModuleSameCollection extends Controller {
//User Product History
public function index($product_id) {
echo $product_id;
}
}
I have try to call it inside another controller like this $data['same_color'] = $this->load->controller('module/same_color' ,['product_id' => 2] );
and I try to by access it using url like this
mydomain.com/index.php?route=module/same_collection&product_id=2
but it's not working. Please help!!!
Upvotes: 3
Views: 1915
Reputation: 1619
It seems like you have not created your module properly. Make sure your module's setting is saved in module
table . If your module's code is not there in the table then you won't get any parameter in your index()
method.
Upvotes: 4