![]() |
wrapper method - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: wrapper method (/showthread.php?tid=71803) |
wrapper method - blinkofaneye - 09-25-2018 Hi, So the thing is i have a base class for all my controllers named MY_Controller. PHP Code: class MY_Controller extends CI_Controller what i want is CI calling render() after method() so http://www.example.com/example/method would produce this output: in method in render my question is: "how can i do that?", calling render() in the destructor? RE: wrapper method - ignitedcms - 09-26-2018 What is render()? RE: wrapper method - dave friend - 09-26-2018 Super easy. PHP Code: public function method() Or if you don't want method() calling render() directly PHP Code: class Example extends MY_Controller RE: wrapper method - blinkofaneye - 09-26-2018 i think i didnt explain well ![]() PHP Code: class Example extends MY_Controller the render() method actually calls $this->load->view() to add header, body and footer. PHP Code: class MY_Controller extends CI_Controller i did this but it can lead to security issues RE: wrapper method - InsiteFX - 09-27-2018 And how do think it is going to call it automatically if you do not invoke the method? |