本文整理汇总了PHP中Symfony\Component\Routing\Generator\UrlGenerator::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP UrlGenerator::__construct方法的具体用法?PHP UrlGenerator::__construct怎么用?PHP UrlGenerator::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Routing\Generator\UrlGenerator
的用法示例。
在下文中一共展示了UrlGenerator::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* @param ReadSiteRepositoryInterface $siteRepository
* @param CurrentSiteIdInterface $currentSiteManager
* @param RouteCollection $routes
* @param RequestContext $context
* @param RequestStack $requestStack
* @param NodeManager $nodeManager
* @param LoggerInterface $logger
*/
public function __construct(ReadSiteRepositoryInterface $siteRepository, CurrentSiteIdInterface $currentSiteManager, RouteCollection $routes, RequestContext $context, RequestStack $requestStack, NodeManager $nodeManager, LoggerInterface $logger = null)
{
parent::__construct($routes, $context, $logger);
$this->siteRepository = $siteRepository;
$this->currentSiteManager = $currentSiteManager;
$this->requestStack = $requestStack;
$this->nodeManager = $nodeManager;
}
示例2: __construct
public function __construct(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = null, $_locale = null)
{
/**
* The $_locale parameter is automatically retrived from the container
* if the LocaleService is availble
*/
parent::__construct($routes, $context, $logger);
$this->locale = $_locale;
}
示例3: __construct
/**
* Constructor.
*
* @param \Symfony\Component\Routing\RouteCollection $routes
* @param \Symfony\Component\Routing\RequestContext $context
* @param \Symfony\Component\HttpFoundation\Request $request
* @param array $configuration
*/
public function __construct(RouteCollection $routes, RequestContext $context, Request $request, $configuration)
{
parent::__construct($routes, $context);
$this->preserve = $configuration['preserve'];
$this->token = $configuration['token'];
$this->tokenLen = $configuration['token_len'] ?: self::DEFAULT_TOKEN_LENGTH;
if ($this->token) {
$this->preserve[] = $this->token;
}
$this->params = $this->getParamsFromQuery($request->query);
if ($this->token && !$this->params->has($this->token)) {
$this->params->set($this->token, $this->generateToken());
}
}
示例4: __construct
public function __construct(\Pimple $container, RouteCollection $routes, RequestContext $context)
{
$this->container = $container;
$this->routes = $routes;
parent::__construct($routes, $context);
}
示例5: __construct
public function __construct(UrlGeneratorInterface $generator, RequestContext $context, LoggerInterface $logger = null)
{
parent::__construct(new RouteCollection(), $context, $logger);
$this->generator = $generator;
}
示例6: __construct
/**
* @param RequestContext $context
* @param CacheInterface $cache
* @param LoggerInterface $logger
*/
public function __construct(RequestContext $context, CacheInterface $cache, LoggerInterface $logger = null)
{
parent::__construct(new RouteCollection(), $context, $logger);
$this->cache = $cache;
}