public function processArguments($args, IContext $context) { return array_map(function ($arg) use($context) { if (!is_string($arg)) { return $arg; } elseif (String::startsWith($arg, "%")) { return $context->getService(substr($arg, 1)); } elseif (String::startsWith($arg, "\$\$")) { return Environment::getConfig(substr($arg, 2)); } elseif (String::startsWith($arg, "\$")) { return Environment::getVariable(substr($arg, 1)); } else { return $arg; } }, $args); }
/** * Returns TemplateLocator. * * @author Jan Tvrdík * @return TemplateLocator */ protected function getTemplateLocator() { return $this->context->getService('StaticWeb\\TemplateLocator'); }
/** * @return Nette\Web\Session */ protected function getSession($namespace = NULL) { $handler = $this->context->getService('Nette\\Web\\Session'); return $namespace === NULL ? $handler : $handler->getNamespace($namespace); }
/** * @return Nette\Web\User */ public function getUser() { return $this->context->getService('Nette\\Web\\IUser'); }