Exemplo n.º 1
1
 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);
 }
Exemplo n.º 2
1
 /**
  * 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);
 }
Exemplo n.º 3
0
 /**
  * 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;
 }
Exemplo n.º 4
0
 /**
  * Constructor.
  *
  * @param LegacyContext $context
  */
 public function __construct(LegacyContext $context)
 {
     $this->legacyContext = $context->getContext();
 }