mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-03 18:38:31 +03:00
Add an ability to generate https routes
This commit is contained in:
parent
82a3cb7dd5
commit
e9f480e3ef
@ -97,6 +97,26 @@ abstract class AbstractController implements RouterAwareInterface, Authenticatio
|
||||
return $this->getRouter()->generate($route, $parameters, $referenceType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates an HTTPS URL from the given parameters.
|
||||
*
|
||||
* @param string $route The name of the route.
|
||||
* @param mixed $parameters An array of parameters.
|
||||
*
|
||||
* @return string The generated URL.
|
||||
*/
|
||||
public function generateSecureUrl($route, $parameters = array())
|
||||
{
|
||||
$context = $this->getRouter()->getContext();
|
||||
|
||||
return 'https://' . $context->getHost()
|
||||
. $this->getRouter()->generate(
|
||||
$route,
|
||||
$parameters,
|
||||
UrlGeneratorInterface::ABSOLUTE_PATH
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a RedirectResponse to the given URL.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user