![]() |
hijacking \CodeIgniter\Controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: hijacking \CodeIgniter\Controller (/showthread.php?tid=71784) |
hijacking \CodeIgniter\Controller - titounnes - 09-24-2018 Hi. Can anyone give an example, how to hijack \Codeigniter\Controllet as MY_Controller in version 3 RE: hijacking \CodeIgniter\Controller - InsiteFX - 09-24-2018 The base controller: PHP Code: <?php namespace App\Controllers; The Admin controller: PHP Code: <?php namespace App\Controllers; The Public controller: PHP Code: <?php namespace App\Controllers; Is that what your looking for? RE: hijacking \CodeIgniter\Controller - titounnes - 09-24-2018 When I add script parent::_construct() in baseController, why do I get Error 500? RE: hijacking \CodeIgniter\Controller - InsiteFX - 09-24-2018 There is no CodeIgniter __construct in the Controller anymore. Leave the parent::__construct() out. If you look at system Controller.php you will see that there is no constructor method It's added to the BaseController for passing parameters to the other controllers. Also remove the helpers ad the begging of the BaseController it is in the Controller now. RE: hijacking \CodeIgniter\Controller - titounnes - 09-24-2018 (09-24-2018, 09:37 AM)InsiteFX Wrote: There is no CodeIgniter __construct in the Controller anymore. Many thanks for your explanation. RE: hijacking \CodeIgniter\Controller - titounnes - 09-24-2018 I found this script from Killishan's blog and your pdf. Code: class Home extends \CodeIgniter\Controller RE: hijacking \CodeIgniter\Controller - InsiteFX - 09-25-2018 That is old code, the controller has been changed since that was written. The controller doe's not pass the $params anymore. Look at the System Controller code and you will see the change |