Is there a function I can use to extract a requested URL?
I want to evaluate the path in a case statement to import my views/includes/etc so if anyone can point me in the direction of something I would be really grateful.
i was going to use something like this…
function curPageURL() {
//create url prefix ie https://...etc
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on"){$pageURL .= "s";}
$pageURL .= "://";
//if not on port 80 find out which port were on
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
//return full url string
return $pageURL;
}
variable = curPageURL();
Figured this one out.
If anyone has this idea just set a variable value and sent it accorss the URL, a la…
then intercept that in a controller (via an include on the main template, I use my own MVC with a nav controller), like this….
Its simple and effective but I hope it helps somebody somewhere.