本文整理汇总了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;
}
示例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];
}
}
示例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');
}
示例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']);
}
示例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);
}
示例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());
}
示例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']));
}
}
示例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();
}
示例9: lock
private function lock()
{
Environment::lock('db', $this->context->getParameters()['tempDir']);
}
示例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"];
}
示例11: injectParameters
public function injectParameters(\Nette\DI\Container $di)
{
$this->conf = $di->getParameters();
}
示例12: InjectableTrait_injectParameters
public final function InjectableTrait_injectParameters(\Nette\DI\Container $container)
{
$this->InjectableTrait_parameters = $container->getParameters();
}
示例13: __construct
public function __construct(Container $container, \Nette\Http\Request $httpRequest)
{
$this->config = $container->getParameters();
$this->httpRequest = $httpRequest;
}
示例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"];
}