Equivalent to "uri rsegment"? |
Hello,
I would like to know if there is an equivalent to "$this->uri->rsegment()" in CI4? I'm searching in the doc but I don't find anything about that. I tried "$this->request->uri->getSegments()" in my default routed controller but I get an array with two empty strings. My default route: $routes->get('/', 'Corporate/Landing::index'); GetSegments output: ["",""] (11-25-2019, 02:56 AM)RedskyThirty Wrote: Здравствуйте,What did you want to get if uri is "/"? If you open "/corporate/landing" in example, getSegments() returns ['', 'corpotate', 'landing']. CI4 doesn't have getRSegment method, only getSegment() and getSegments() You can view all methods in file /system/HTTP/URI.php
(11-25-2019, 02:43 PM)XTAZ Wrote:(11-25-2019, 02:56 AM)RedskyThirty Wrote: Здравствуйте,What did you want to get if uri is "/"? If you open "/corporate/landing" in example, getSegments() returns ['', 'corpotate', 'landing']. Yes, I would like to get ['corporate', 'landing', 'index']. It was really helpful in CI3. There is no equivalent for the moment? Or a way to do that? |
Welcome Guest, Not a member yet? Register Sign In |