当前位置: 首页>>代码示例>>PHP>>正文


PHP Controller::setContainer方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:mapbender,项目名称:fom,代码行数:13,代码来源:RegistrationController.php

示例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'];
 }
开发者ID:hyperbolaa,项目名称:UeditorBundle,代码行数:7,代码来源:UeditorController.php

示例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();
     }
 }
开发者ID:mapbender,项目名称:fom,代码行数:13,代码来源:PasswordController.php

示例4: setContainer

 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->translator = $container->get('translator');
     if (method_exists($this, 'init')) {
         $this->init();
     }
 }
开发者ID:jlaso,项目名称:tradukoj,代码行数:8,代码来源:BaseController.php

示例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');
 }
开发者ID:junjinZ,项目名称:wealthbot,代码行数:8,代码来源:DocusignController.php

示例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');
 }
开发者ID:jarves,项目名称:jarves,代码行数:8,代码来源:ManagerController.php

示例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');
 }
开发者ID:hidenorigoto,项目名称:XnniUtilBundle,代码行数:8,代码来源:ORMController.php

示例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');
 }
开发者ID:jarves,项目名称:jarves,代码行数:8,代码来源:BackendController.php

示例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');
     }
 }
开发者ID:asgoodasnu,项目名称:dhlapi,代码行数:14,代码来源:SerializerController.php

示例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');
 }
开发者ID:jarves,项目名称:jarves,代码行数:9,代码来源:EditorController.php

示例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');
 }
开发者ID:jarves,项目名称:jarves,代码行数:9,代码来源:UITranslationsController.php

示例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');
 }
开发者ID:jarves,项目名称:jarves,代码行数:10,代码来源:FileController.php

示例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');
 }
开发者ID:jarves,项目名称:jarves,代码行数:12,代码来源:AdminController.php

示例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());
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:17,代码来源:ControllerTest.php

示例15: setContainer

 /**
  * Override method to call #containerInitialized method when container set.
  * {@inheritdoc}
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->setManager();
 }
开发者ID:homerjsimpson000,项目名称:CommandSchedulerBundle,代码行数:9,代码来源:BaseController.php


注:本文中的Symfony\Bundle\FrameworkBundle\Controller\Controller::setContainer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。