use \Director; $url = Director::absoluteURL('/path/to/page');
use \Director; $url = Director::absoluteURL('my-route-name');This code will generate an absolute URL for the named route `my-route-name`. The route must be defined in the application's routing configuration file. Package library: SilverStripe Framework (included with the Content Management System).