當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Container::getParameters方法代碼示例

本文整理匯總了PHP中Nette\DI\Container::getParameters方法的典型用法代碼示例。如果您正苦於以下問題:PHP Container::getParameters方法的具體用法?PHP Container::getParameters怎麽用?PHP Container::getParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Nette\DI\Container的用法示例。


在下文中一共展示了Container::getParameters方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create

 public function create()
 {
     $programModel = $this->em->reflection('Program');
     $sectionId = empty($this->sectionId) ? $this->context->getParameters()['sectionId'] : $this->sectionId;
     //$from
     $form = new ProgramEditFormControl($sectionId);
     $form->setDefaultTimeFrom($this->context->getParameters()['programStart']);
     $startPlusOneHour = clone $this->context->getParameters()['programStart'];
     $startPlusOneHour->add(\DateInterval::createFromDateString('1 hour'));
     $form->setDefaultTimeTo($startPlusOneHour);
     $form->setProgramId($this->programId);
     $form->setEm($programModel, $this->em);
     return $form;
 }
開發者ID:bombush,項目名稱:NatsuCon,代碼行數:14,代碼來源:ProgramEditFormFactory.php

示例2: __construct

 public function __construct(Container $container)
 {
     $p = $container->getParameters();
     foreach (['app' => 'appDir', 'backup' => 'backupDir', 'bin' => 'binDir', 'libs' => 'libsDir', 'log' => 'logDir', 'migrations' => 'migrationsDir', 'temp' => 'tempDir', 'tests' => 'testsDir', 'www' => 'wwwDir'] as $prop => $key) {
         $this->{$prop} = $p[$key];
     }
 }
開發者ID:VasekPurchart,項目名稱:khanovaskola-v3,代碼行數:7,代碼來源:Paths.php

示例3: __construct

 public function __construct(Container $context)
 {
     parent::__construct();
     $secured = NULL;
     if ($context->getParameters()['tls']) {
         Route::$defaultFlags |= Route::SECURED;
         $secured = Route::SECURED;
     }
     $this[] = new StaticRouter(['Homepage:default' => 'index.php'], StaticRouter::ONE_WAY | $secured);
     $this[] = new StaticRouter(['Homepage:default' => '', 'Homepage:marathon' => 'maraton', 'Homepage:preklad' => 'preklad', 'Profile:default' => 'profil', 'Auth:in' => 'prihlaseni', 'Auth:out' => 'odhlaseni', 'Auth:registration' => 'registrace', 'Auth:resetPassword' => 'heslo', 'Text:about' => 'o-skole', 'Text:team' => 'o-skole/tym', 'Subjects:default' => 'predmety', 'File:opensearch' => 'opensearch.xml', 'File:robots' => 'robots.txt', 'Sitemap:default' => 'sitemap.xml', 'Text:tos' => 'podminky', 'Text:privacy' => 'soukromi'], $secured);
     $this[] = new Route('vyhledavani/?hledat=<query>', 'Search:results');
     $this[] = new Route('vyhledavani/cviceni', 'Search:blueprints');
     $this[] = new Route('schema/[<action \\D+>/]<schemaId \\d+>[-<slug>]', 'Schema:default');
     $this[] = new Route('blok/[<action \\D+>/][<schemaId \\d+>/]<blockId \\d+>[-<slug>]', 'Block:default');
     $this[] = new Route('video/[<action \\D+>/][[<schemaId \\d+>/]<blockId \\d+>/]<videoId \\d+>[-<slug>]?zacatek=<startAtTime \\d+>', 'Video:default');
     $this[] = new Route('cviceni/[<action \\D+>/][[<schemaId \\d+>/]<blockId \\d+>/]<blueprintId \\d+>[-<slug>]', 'Blueprint:default');
     $this[] = new Route('tabule/[<action \\D+>/][[<schemaId \\d+>/]<blockId \\d+>/]<blackboardId \\d+>[-<slug>]?zacatek=<startAtTime \\d+>', 'Blackboard:default');
     // old links
     $this[] = new Route('video/<youtubeId>', 'Video:youtube');
     $this[] = new Redirect('dobrovolnici', 'https://wiki.khanovaskola.cz/doku.php?id=dobrovolnici');
     $this[] = new Redirect('dobrovolnici/preklad', 'https://wiki.khanovaskola.cz/doku.php?id=jaknato');
     $this[] = new Redirect('dobrovolnici/pravidla-prekladu', 'https://wiki.khanovaskola.cz/doku.php?id=pravidla');
     $this[] = new Redirect('o-skole/projekty', 'https://wiki.khanovaskola.cz/doku.php?id=start');
     $this[] = new Redirect('kontakt', 'https://wiki.khanovaskola.cz/doku.php?id=tym');
     $this[] = $context->createInstance(Routers\OldVideo::class);
     $this[] = $context->createInstance(Routers\OldCategory::class);
     $this[] = $context->createInstance(Routers\OldBlog::class);
     $this[] = new Route('<presenter>/<action \\D+>[/<id>]', 'Homepage:default');
 }
開發者ID:VasekPurchart,項目名稱:khanovaskola-v3,代碼行數:29,代碼來源:Router.php

示例4: createFromContainer

 public static function createFromContainer(Container $context)
 {
     /** @var EntityManager $em */
     $em = $context->getByType(EntityManager::class);
     /** @var Configuration $conf */
     $conf = $context->getByType(Configuration::class);
     return new self($em, $conf, $context->getParameters()['tempDir']);
 }
開發者ID:instante,項目名稱:php-test-suite,代碼行數:8,代碼來源:DoctrineTester.php

示例5: create

 static function create(Container $container)
 {
     $fakerinoConf = array();
     $configuration = $container->getParameters();
     if (array_key_exists(self::FAKERINO_TAG, $configuration)) {
         $fakerinoConf = $configuration[self::FAKERINO_TAG];
     }
     return Fakerino::create($fakerinoConf);
 }
開發者ID:fakerino,項目名稱:nette-fakerino,代碼行數:9,代碼來源:FakerinoServiceFactory.php

示例6: __construct

 /**
  * @param Container $container
  * @param ManagerRegistry $registry
  */
 public function __construct(Container $container, ManagerRegistry $registry)
 {
     parent::__construct('dwarfSearch:import');
     $this->entityManager = $registry->getManager();
     $this->seasonsRepository = $registry->getRepository(Season::class);
     $this->episodesRepository = $registry->getRepository(Episode::class);
     $this->languagesRepository = $registry->getRepository(Language::class);
     $this->charactersRepository = $registry->getRepository(Character::class);
     $this->scenariosDir = Helpers::expand('%appDir%/../scenarios', $container->getParameters());
 }
開發者ID:legendik,項目名稱:DwarfSearch,代碼行數:14,代碼來源:ScreenplayImportCommand.php

示例7: _after

 public function _after(TestInterface $test)
 {
     if ($this->container) {
         try {
             $this->container->getByType(Session::class)->close();
         } catch (MissingServiceException $e) {
         }
         try {
             $journal = $this->container->getByType(IJournal::class);
             if ($journal instanceof SQLiteJournal) {
                 $property = new ReflectionProperty(SQLiteJournal::class, 'pdo');
                 $property->setAccessible(true);
                 $property->setValue($journal, null);
             }
         } catch (MissingServiceException $e) {
         }
         FileSystem::delete(realpath($this->container->getParameters()['tempDir']));
     }
 }
開發者ID:arachne,項目名稱:codeception,代碼行數:19,代碼來源:NetteDIModule.php

示例8: sendActivationEmail

 /**
  * @param string $email
  * @param \Model\Core\User\User $user
  */
 private function sendActivationEmail($email, $user)
 {
     $template = $this->template;
     $template->setFile(__DIR__ . "/activate.email.latte");
     $template->appname = $this->presenter->getAppName();
     $template->username = $user->getUsername();
     $key = $this->actionKey->createKey(\Model\Core\ActionKey\ActionKeyTypeCode::REGISTER, $user->getId());
     $template->link = $this->presenter->link("//Homepage:activate", array("id" => $user->getId(), "key" => $key->getKey()));
     $template->activate = $this->container->getParameters()["register"]["activation"];
     $this->mailer->createMessage($email, "Vítejte na " . $this->presenter->getAppName(), (string) $template);
     $this->mailer->send();
 }
開發者ID:JZechy,項目名稱:ZBox,代碼行數:16,代碼來源:RegisterForm.php

示例9: lock

 private function lock()
 {
     Environment::lock('db', $this->context->getParameters()['tempDir']);
 }
開發者ID:rhrebecek,項目名稱:skeleton,代碼行數:4,代碼來源:DatabaseTester.php

示例10: __construct

 /**
  * BasePresenter constructor.
  * @param \Nette\DI\Container $container
  */
 public function __construct(\Nette\DI\Container $container)
 {
     $params = $container->getParameters();
     $this->appspace = $params["appspace"];
     $this->appname = $params["appname"];
 }
開發者ID:JZechy,項目名稱:ZBox,代碼行數:10,代碼來源:BasePresenter.php

示例11: injectParameters

 public function injectParameters(\Nette\DI\Container $di)
 {
     $this->conf = $di->getParameters();
 }
開發者ID:sg3tester,項目名稱:songator,代碼行數:4,代碼來源:PrimePresenter.php

示例12: InjectableTrait_injectParameters

 public final function InjectableTrait_injectParameters(\Nette\DI\Container $container)
 {
     $this->InjectableTrait_parameters = $container->getParameters();
 }
開發者ID:dtforce,項目名稱:nette-inject,代碼行數:4,代碼來源:InjectableTrait.php

示例13: __construct

 public function __construct(Container $container, \Nette\Http\Request $httpRequest)
 {
     $this->config = $container->getParameters();
     $this->httpRequest = $httpRequest;
 }
開發者ID:MrTommy1979,項目名稱:reference,代碼行數:5,代碼來源:DescriptionForm.php

示例14: __construct

 /**
  * SmtpMailer constructor.
  * @param \Nette\DI\Container $container
  */
 public function __construct(\Nette\DI\Container $container)
 {
     $this->container = $container;
     $this->smtpMailer = new \Nette\Mail\SmtpMailer($container->getParameters()["mailer"]);
     $this->from = $container->getParameters()["mailer"]["from"];
 }
開發者ID:JZechy,項目名稱:ZBox,代碼行數:10,代碼來源:Mailer.php


注:本文中的Nette\DI\Container::getParameters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。