开发者

Codeigniter arbitrary length URI

开发者 https://www.devze.com 2023-01-13 03:07 出处:网络
In codeigniter I am trying to make an application which will accept a URI of an arbitrary length, such as:

In codeigniter I am trying to make an application which will accept a URI of an arbitrary length, such as:

http://example.com/files/some/arbitrary/length/uri

In开发者_如何学Python the routes.php file i have the following rule to get the first URI segment:

$route['files/(:any)'] = "files/uri/$1";

How would I be able to get the rest of the address as a variable not knowing how many URI segments there might be in it?

Thanks, Diarmuid


Figured it out.

Keeping the same route.php rule as before I then use codeigniters URL_Helper function uri_string() to get the URI segments. This can then be broken up into an array using the explode function.

0

精彩评论

暂无评论...
验证码 换一张
取 消