Is there a way to call a method inside the controller from our view using codeigniter.I know it is a bad practice but, now I force to do this.Thank you
+3
A:
You can just do:
$this->controller_method();
While this might answer your question, I personally agree with the comments of – Matthew J Morrison and DamienL.
Kurucu
2010-06-08 13:14:33
A:
in your controller put
$data['myClass'] = $this;
That way when you send the data to the view, it will load the controller :)
Then you can access the methods like
$myClass->method();
Haruo
2010-06-08 16:30:49