Welcome Guest, Not a member yet? Register   Sign In
Equivalent to "uri rsegment"?
#1

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: ["",""]
Reply
#2

(11-25-2019, 02:56 AM)RedskyThirty Wrote: Здравствуйте,

я хотел бы знать, есть ли эквивалент в «$ this-> uri-> rsegment ()» в CI4?
Я ищу в документе, но ничего об этом не нахожу.


Я попытался "$ this-> request-> uri-> getSegments ()" в моем маршрутизируемом контроллере по умолчанию, но я получил массив с двумя пустыми строками.
Мой маршрут по умолчанию: $ rout-> get ('/', 'Corporate / Landing :: index');
Вывод GetSegments: ["", ""]
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
Reply
#3

(11-25-2019, 02:43 PM)XTAZ Wrote:
(11-25-2019, 02:56 AM)RedskyThirty Wrote: Здравствуйте,

я хотел бы знать, есть ли эквивалент в «$ this-> uri-> rsegment ()» в CI4?
Я ищу в документе, но ничего об этом не нахожу.


Я попытался "$ this-> request-> uri-> getSegments ()" в моем маршрутизируемом контроллере по умолчанию, но я получил массив с двумя пустыми строками.
Мой маршрут по умолчанию: $ rout-> get ('/', 'Corporate / Landing :: index');
Вывод GetSegments: ["", ""]
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

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?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB