本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Controller\Controller::setContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::setContainer方法的具体用法?PHP Controller::setContainer怎么用?PHP Controller::setContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Controller\Controller
的用法示例。
在下文中一共展示了Controller::setContainer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setContainer
/**
* Check if self registration is allowed.
*
* setContainer is called after controller creation is used to deny access to controller if self registration has
* been disabled.
*/
public function setContainer(ContainerInterface $container = NULL)
{
parent::setContainer($container);
if (!$this->container->getParameter('fom_user.selfregister')) {
throw new AccessDeniedHttpException();
}
}
示例2: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$options = $this->container->getParameter('hyperbolaa_ueditor');
$this->http_max_age = $options['http_max_age'];
$this->https_max_age = $options['https_max_age'];
}
示例3: setContainer
/**
* Check if password reset is allowed.
*
* setContainer is called after controller creation is used to deny access to controller if password reset has
* been disabled.
*/
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
if (!$this->container->getParameter('fom_user.reset_password')) {
throw new AccessDeniedHttpException();
}
}
示例4: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->translator = $container->get('translator');
if (method_exists($this, 'init')) {
$this->init();
}
}
示例5: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->api = $this->get('wealthbot_docusign.api_client');
$this->signatureManager = $this->get('wealthbot_docusign.document_signature.manager');
$this->electronicSignature = $this->get('wealthbot_docusign.electronic_signature_service');
$this->em = $this->get('doctrine.orm.entity_manager');
}
示例6: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->jarves = $this->container->get('jarves');
$this->localFilesystem = $this->container->get('jarves.filesystem.local');
$this->rootDir = $this->container->getParameter('kernel.root_dir');
$this->utils = $this->container->get('jarves.utils');
}
示例7: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
if (!$this->container->has('doctrine.orm.entity_manager')) {
throw new InvalidConfigurationException();
}
$this->em = $this->container->get('doctrine.orm.entity_manager');
}
示例8: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->pageStack = $this->get('jarves.page_stack');
$this->jarves = $this->get('jarves');
$this->acl = $this->get('jarves.acl');
$this->utils = $this->get('jarves.utils');
}
示例9: setContainer
/**
* Overwritten to ensure to have a service container
*
* @param ContainerInterface $container
*/
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
if (is_null($container)) {
$this->serializer = null;
} else {
$this->serializer = $this->get('jms_serializer');
}
}
示例10: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->jarves = $this->get('jarves');
$this->localFilesystem = $this->get('jarves.filesystem.local');
$this->objects = $this->get('jarves.objects');
$this->utils = $this->get('jarves.utils');
$this->configurationOperator = $this->get('jarves.configuration_operator');
}
示例11: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->jarves = $this->get('jarves');
$this->pageStack = $this->get('jarves.page_stack');
$this->translator = $this->get('jarves.translator');
$this->webFilesystem = $this->get('jarves.filesystem.web');
$this->templating = $this->get('templating');
}
示例12: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->jarves = $this->container->get('jarves');
$this->pageStack = $this->container->get('jarves.page_stack');
$this->objects = $this->container->get('jarves.objects');
$this->webFilesystem = $this->container->get('jarves.filesystem.web');
$this->utils = $this->container->get('jarves.utils');
$this->acl = $this->container->get('jarves.acl');
}
示例13: setContainer
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->jarves = $this->get('jarves');
$this->acl = $this->get('jarves.acl');
$this->pageStack = $this->get('jarves.page_stack');
$this->contentRender = $this->get('jarves.content.render');
$this->logger = $this->get('logger');
$this->encoderFactory = $this->get('security.encoder_factory');
$this->tokenStorage = $this->get('security.token_storage');
$this->userProvider = $this->get('jarves.user_provider');
}
示例14: testForward
public function testForward()
{
$request = Request::create('/');
$request->setLocale('fr');
$request->setRequestFormat('xml');
$kernel = $this->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
$kernel->expects($this->once())->method('handle')->will($this->returnCallback(function (Request $request) {
return new Response($request->getRequestFormat() . '--' . $request->getLocale());
}));
$container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerInterface');
$container->expects($this->at(0))->method('get')->will($this->returnValue($request));
$container->expects($this->at(1))->method('get')->will($this->returnValue($kernel));
$controller = new Controller();
$controller->setContainer($container);
$response = $controller->forward('a_controller');
$this->assertEquals('xml--fr', $response->getContent());
}
示例15: setContainer
/**
* Override method to call #containerInitialized method when container set.
* {@inheritdoc}
*/
public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
$this->setManager();
}