Jump to content

$input->urlSegments


diogo
 Share

Recommended Posts

Echoing $input->urlSegments returns a useless "Array". Would be nice if it would return "segment1/segment2/segment3/", so we could easily build the current url like this: $page->url.$input->urlSegments.

What do you guys think also of having a url property for $input that returns the current url with segments and pagination $input->url?

Edit: Anyway, just for reference, this can be done with $_SERVER['REQUEST_URI']. I'm only proposing a PW way ;)

  • Like 1
Link to comment
Share on other sites

Echoing $input->urlSegments returns a useless "Array". Would be nice if it would return "segment1/segment2/segment3/", so we could easily build the current url like this: $page->url.$input->urlSegments.

Like mentioned above, urlSegmentStr is your ticket. Note that it has no trailing slash, so you may need to add one to it in some instances. Also want to mention that the $input->urlSegments Array is not useless at all – I use it all the time. :) Just one small example is to count the number of urlSegments: count($input->urlSegments); 

  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...