filter arguments |
hi, let's say i have this route: /user/(:num)
how can i pass the value insude (:num) to a filter? i've read the documentation but it only show an example with hard-coded values.
$uri->getSegments() will give you an array of all segments:
PHP Code: $uri = &$request->uri; For /user/(:num), $segments[0] will be ‘user’ and $segments[1] will be the user id.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |