class Example extends CI_Controller { function __construct() { parent::__construct(); } function show(){ echo "show"; } }
The first step is you have to reassign the Codeigniter object to a variable on the your view files.
$this->method_call =& get_instance();
And then, you can call the controller methods from inside view.
$this->method_call =& get_instance(); $this->method_call->show();
Simple, right? :D
No comments:
Post a Comment