How To Add Filter On Specified HTTP Method and Controller in Routes.php? |
What I've tried to achieve is add filter on specified http method and controller. Like:
PHP Code: $rotues->get('/', 'Home::index', ['filter' => 'user']); But when I call the HTTP GET method, the filter is always use admin while I specified that to use user. How could I achieve this? Thanks.
(03-06-2021, 08:53 AM)IvanBell Wrote: Shouldn't it be $routes instead of $rotues? Ah I have typo inserted in the post, but in my code is $routes Thank you (03-06-2021, 08:35 AM)iRedds Wrote: I cannot reproduce. Yes, and I'm using the 4.0.4 version, and I've found out they fixed it in the latest version https://github.com/codeigniter4/CodeIgni...ssues/3733. But the problem is, if I'm upgrade it, I will encounter with this issue "CI4 Generate Empty String On Query Binding Value On "FALSE" value (codeigniter.com)". This is a big dilemma and chicken and egg for me since I have no choice to upgrade and rewrite the whole code, my God. |
Welcome Guest, Not a member yet? Register Sign In |