Welcome Guest, Not a member yet? Register   Sign In
how get route name from current url?
#1

how get route name from current url?
Reply
#2

Try \CodeIgniter\Config\Services::router()->getMatchedRouteOptions()['as'] ?
Simple CI 4 project for beginners codeigniter-expenses
Reply
#3
Thumbs Up 
(This post was last modified: 10-30-2023, 03:17 AM by asnanmtakim.)

(10-30-2023, 02:31 AM)ozornick Wrote: Try \CodeIgniter\Config\Services::router()->getMatchedRouteOptions()['as'] ?
Thank you very much for you help
Reply
#4

The method is not documented.
https://codeigniter4.github.io/CodeIgnit...uting.html

It may be changed in the future. So I recommend you create a function or method to call above code.
Then, even if the method is changed, you will need to update only the function/method code.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB