CI4 Beta 1: function _remap not works properly - 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: CI4 Beta 1: function _remap not works properly (/showthread.php?tid=73167) |
CI4 Beta 1: function _remap not works properly - hlmqz - 03-25-2019 my english is not the best. in Codeigniter 3 I do: URL: /test/parameter1/parameter2/<parameterN> CI3 called class: Test called method: _remap (I have it function declared). in Codeigniter 3 all works ok. but in Codeigniter 4, with URL: /test CI4 call method _remap, woks ok. but with URL: /test/parameter1 or URL /test/parameter1/parameter2/<parameterN> show error: ReflectionException "Method App\Controllers\Test::parameter1() does not exist" ----- Details: - No setting route additional. - I try wihtout function index, but it does not affect. PHP Code: <?php namespace App\Controllers; excuse my english, I appreciate the help. thanks!! RE: CI4 Beta 1: function _remap not works properly - juworld - 09-25-2019 I'm having the same issue. My approach is to "fool" it by placing a dummy function if I'm not messing with Route Code: public function parameter1() Anyone has a better idea? (03-25-2019, 10:12 PM)hlmqz Wrote: my english is not the best. RE: CI4 Beta 1: function _remap not works properly - ciadmin - 09-25-2019 See https://github.com/codeigniter4/CodeIgniter4/issues/1928 Your controllers are supposed to have an index() method. RE: CI4 Beta 1: function _remap not works properly - juworld - 09-25-2019 Thanks for the speedy reply. Actually, I do have an index() method So, I just pulled down CI 4.0.0-rc.1 This is my code Code: <?php namespace App\Controllers; Anything else I've missed? THanks! jUstin RE: CI4 Beta 1: function _remap not works properly - ciadmin - 09-25-2019 @justin It looks like your _remap purposefully throws an exception if an unrecognozed method is called. How is this incorrect behavior? It sounds like _remap is doing just what your code says it should. RE: CI4 Beta 1: function _remap not works properly - juworld - 09-25-2019 Hi Here, I thought about that, but the error I'm getting is not the 404, but the one shared by the original author of this post. Let me simplify my example to make it more straight forward. Code: <?php namespace App\Controllers; And I tried to access a method that is not there, i.e. /home/go. The _remap should kick in and call $this->go_back() But, that's not happening... |