At the moment you can use arguments in you view path, for example user/%/friends
where % is an argument (user's ID). But is it possible to use an argument in different way, let's say user-%/friends
, so the normal path would look like user-123/friends
instead of user/123/friends
?
Thank you.
no, you can't use arguments like that directly. however you can provide default arguments using php. when writing you can use arg(0) for the first argument in path (say a site.com/user/123/dashboard would return 'user' for arg(0) and 123 for arg(1) etc). i guess you can just use php to parse the path for the argument you want, through regular expressions and string functions.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.