suntrop Posted October 30, 2015 Share Posted October 30, 2015 Hi all! I need to pass a filesystem path (eg my/files/here) via URL and access the full path (URL segments) in a template. I am wondering if there is some way to use PW built in input/url segment functions? Currently I am using ltrim($_SERVER[REQUEST_URI], $page->path) Link to comment Share on other sites More sharing options...
Martijn Geerts Posted October 30, 2015 Share Posted October 30, 2015 // Array of segments $input->urlSegments // Url segments string $input->urlSegmentStr() 2 Link to comment Share on other sites More sharing options...
LostKobrakai Posted October 30, 2015 Share Posted October 30, 2015 The last one does also work as property without the parenthesis. Link to comment Share on other sites More sharing options...
suntrop Posted October 30, 2015 Author Share Posted October 30, 2015 Thanks. How did I miss this? Link to comment Share on other sites More sharing options...
Martijn Geerts Posted October 30, 2015 Share Posted October 30, 2015 Also have to mention that using the $_SERVER[REQUEST_URI] is a bug in potential when using it on an url like this www.domain.com/segement/segment/?name=john. Link to comment Share on other sites More sharing options...
suntrop Posted October 30, 2015 Author Share Posted October 30, 2015 Maybe I could ask in this topic if PW can handle URIs with special characters? I get a 404 error when I try to open example.com/downloader/file%20with-space.txt or example.com/downloader/file-with-á-special-character.txt or example.com/downloader/Champs-%C3%89lys%C3%A9es.txt Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now