public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH) { // By default, consider given parameters in legacy format (no mapping if route not found). $legacyController = $name; $legacyParameters = $parameters; // resolve route & legacy mapping list($legacyController, $legacyParameters) = $this->getLegacyOptions($name, $parameters); return $this->legacyContext->getAdminLink($legacyController, true, $legacyParameters); }
/** * This is a Twig port of the Smarty {$link->getAdminLink()} function. * * @param string $controller the controller name * @param bool $withToken * @param array[string] $extraParams * * @return string */ public function getAdminLink($controllerName, $withToken = true, $extraParams = array()) { return $this->context->getAdminLink($controllerName, $withToken, $extraParams); }
/** * Constructor. * * @param LegacyContext $context * @param TokenStorage $securityTokenStorage */ public function __construct(LegacyContext $context, TokenStorage $securityTokenStorage, UserProviderInterface $userProvider) { $this->context = $context; $this->legacyContext = $context->getContext(); $this->securityTokenStorage = $securityTokenStorage; $this->userProvider = $userProvider; }
/** * Constructor. * * @param LegacyContext $context */ public function __construct(LegacyContext $context) { $this->legacyContext = $context->getContext(); }