![]() |
Potential Bug Report: Presenter::show(id) Overwrites Custom Functions - 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: Potential Bug Report: Presenter::show(id) Overwrites Custom Functions (/showthread.php?tid=91063) |
Potential Bug Report: Presenter::show(id) Overwrites Custom Functions - MZahov - 06-12-2024 When using CodeIgniter 4, the Presenter show(id) method appears to overwrite custom functions that I have added. This results in a 404 error when trying to access these functions, with the message: Code: { However, if I configure the routes in Routes.php to exclude the show method using ['except' => 'show'], the custom functions work correctly. PHP Code: $routes->presenter('example', ['except' => 'show', 'filter'=> 'jwt', 'namespace' => '\App\Controllers\Api']); How to exclude only example/(;segment). So additional functions will not be overwritten. Any suggestions? Code: +--------+-------------------------+--------------------+--------------------------------------------------------------------+----------------+---------------+ https://codeigniter.com/user_guide/incoming/restful.html#presenter-controller-comparison RE: Potential Bug Report: Presenter::show(id) Overwrites Custom Functions - kenjis - 06-12-2024 Define the routes for the custom functions before calling the `$routes->presenter('example', ...)`. RE: Potential Bug Report: Presenter::show(id) Overwrites Custom Functions - MZahov - 06-12-2024 (06-12-2024, 02:47 AM)kenjis Wrote: Define the routes for the custom functions before calling the `$routes->presenter('example', ...)`.Thanks. Feeling stupid that I didn't move it ![]() |