Getting Page Path and Query String With JUri


/ Published in: PHP
Save to your folder(s)

Can use JUri to get the page handle


Copy this code and paste it in your HTML
  1. //Get the page path e.g. /category/sub-category/sompage.html
  2. JUri::getInstance()->toString(array('path'));
  3.  
  4. //Get the page path with query string e.g. /category/sub-category/sompage.html?param=val&param2=val2
  5. JUri::getInstance()->toString(array('path','query'));
  6.  
  7. //Retreive just the query string
  8. JUri::getInstance()->getQuery()
  9.  
  10. or
  11.  
  12. JUri::getInstance()->toString(array('query'));

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.