forked from adampatterson/Tentacle
-
Notifications
You must be signed in to change notification settings - Fork 1
Adam Patterson edited this page Dec 18, 2012
·
1 revision
The URL library is designed to make it easier for you to manage URLs for your application. To load the URL library manually you may do this:
load::library('url');
Returns the full URL to a page in your application. It automatically adjusts if you are using Fancy URLs. If you wanted the URL of a page mycontroller/myfunc then you would do this:
// EX: http://www.evanbot.com/index.php/mycontroller/myfunc
$url = url::page('mycontroller/myfunc');
Returns the base URL to your application.
// EX: http://www.evanbot.com/
$application_base = url::base();
If you set the optional first argument to TRUE then it will append index.php/ onto the URL if you are not using Fancy URLs.
// EX: http://www.evanbot.com/index.php/
$application_base = url::base(TRUE);
Redirects the user's browser to another page in your application. To redirect the user to mycontroller/myfunc then you would do this:
url::redirect('mycontroller/myfunc');