當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。