Call function from controller in view |
How can i call products() function from CategoryController in app/views/category.php
app/views/category.php <?php $this->products() ?> app/controllers/CategoryController.php PHP Code: <?php namespace App\Controllers;
You should not be calling a method from a controller in you views, that would be breaking the MVC rule.
If you need something like that then create a library or helper with the method in it. To execute a method in the controller use an CodeIgniter achor or html link. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |