/** * Creates an absolute URL based on the given controller and action information. * @param string $route the URL route. This should be in the format of 'ControllerID/ActionID'. * @param array $params additional GET parameters (name=>value). Both the name and value will be URL-encoded. * @param string $schema schema to use (e.g. http, https). If empty, the schema used for the current request will be used. * @param string $ampersand the token separating name-value pairs in the URL. * @return string the constructed URL */ public function createUrl($route, $params = array(), $schema = '', $ampersand = '&') { $url = parent::createUrl($route, $params, $ampersand); if (strpos($url, 'http') === 0) { return $url; } else { return $this->getRequest()->getHostInfo($schema) . $url; } }