本文整理汇总了PHP中Nette\Application\UI\Presenter::startup方法的典型用法代码示例。如果您正苦于以下问题:PHP Presenter::startup方法的具体用法?PHP Presenter::startup怎么用?PHP Presenter::startup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Presenter
的用法示例。
在下文中一共展示了Presenter::startup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startup
protected function startup()
{
parent::startup();
if ($this->getParameter('debug', FALSE)) {
\Nette\Diagnostics\Debugger::$productionMode = FALSE;
}
}
示例2: startup
protected function startup()
{
parent::startup();
$this->items = $this->context->createServiceFiles();
$this->template->setFile('');
// nebude shanet sablonu
}
示例3: startup
protected function startup()
{
parent::startup();
if (!$this->type) {
$this->type = key($this->securityManager->getUserTypes());
}
}
示例4: startup
/**
* startup method
* @return void
*/
public function startup()
{
parent::startup();
$this->lang = $this->translator->setLanguage($this->lang);
$this->user = $this->getUser();
return;
}
示例5: startup
protected function startup()
{
parent::startup();
// Login check
if ($this->getName() != 'Admin:Sign') {
$role = $this->user->getRoles();
$roleCheck = $this->database->table("users_roles")->get($role[0]);
if ($roleCheck->admin_access == 0) {
$this->flashMessage($this->translator->translate('messages.sign.invalidLogin'), "error");
$this->redirect(':Admin:Sign:in');
}
if ($this->user->isLoggedIn()) {
} else {
if ($this->user->logoutReason === Nette\Security\IUserStorage::INACTIVITY) {
$this->flashMessage($this->translator->translate('messages.sign.youWereLoggedIn'), "note");
}
$this->redirect('Sign:in', array('backlink' => $this->storeRequest()));
}
}
if ($this->user->isLoggedIn()) {
$this->template->isLoggedIn = TRUE;
$this->template->member = $this->database->table("users")->get($this->user->getId());
}
// Set values from db
$this->template->settings = $this->database->table("settings")->fetchPairs("setkey", "setvalue");
$this->template->appDir = APP_DIR;
$this->template->signed = TRUE;
$this->template->langSelected = $this->translator->getLocale();
// Set language from cookie
if ($this->context->httpRequest->getCookie('language_admin') == '') {
$this->translator->setLocale($this->translator->getDefaultLocale());
} else {
$this->translator->setLocale($this->context->httpRequest->getCookie('language_admin'));
}
}
示例6: startup
protected function startup()
{
parent::startup();
$this->template->page = $this->getName();
$this->template->cartCount = 1;
$this->template->cartPrice = 3600;
}
示例7: startup
protected function startup()
{
parent::startup();
if (!$this->getUser()->isLoggedIn()) {
//throw new BadRequestException;
}
}
示例8: startup
protected function startup()
{
parent::startup();
if ($this->authentication->getCredential() !== substr($this->httpRequest->getHeader('authorization'), 6)) {
//throw new AuthenticationException();
}
}
示例9: startup
function startup()
{
parent::startup();
if (isset($this->module)) {
Options::extend($this->module, $this->moduleparams);
Options::read($this->params);
}
if (array_key_exists("conffile", $this->params)) {
Options::read(array("conffile" => $this->params["conffile"]));
} else {
if (getenv("MONDARC")) {
Options::readFile(getenv("MONDARC"));
}
}
Options::readEnv();
Options::read($this->params);
if (Options::get("configinfo")) {
foreach (Options::get() as $key => $val) {
$arr = Options::info($key);
if ($arr["default"]) {
CliLogger::log(sprintf("Option %s => Value:'%s', set from:defaults\n", $key, $arr["value"]), Debugger::ERROR);
} else {
CliLogger::log(sprintf("Option %s => Value:'%s', set from:%s\n", $key, $arr["value"], $arr["setfrom"]), Debugger::ERROR);
}
}
self::mexit();
}
if ($this->name == $this->action) {
$this->Help(Options::get("xhelp"));
}
}
示例10: startup
public function startup()
{
parent::startup();
if (!$this->getRequest()->isMethod(Nette\Application\Request::FORWARD)) {
$this->error();
}
}
示例11: startup
/**
* @throws \LiveTranslator\TranslatorException
*/
public function startup()
{
parent::startup();
if ($this->user->isLoggedIn()) {
//$this->usermanager->lastLogged($this->user->id);
}
}
示例12: startup
public function startup()
{
parent::startup();
if (!in_array($this->locale, array('cs', 'en'))) {
$this->redirect('this', array('locale' => 'en'));
}
}
示例13: startup
public function startup()
{
parent::startup();
$this->template->max_rating = $this->global_settings->getMaxRating();
$this->template->image_dir = __DIR__ . '/../../www/images/games/';
$this->template->title = '';
}
示例14: startup
protected function startup()
{
parent::startup();
if (!$this->user->isLoggedIn()) {
$this->redirect('Sign:in', array('backlink' => $this->storeRequest()));
}
}
示例15: startup
protected function startup()
{
parent::startup();
if (!$this->user->isLoggedIn() && $this->name != "Sign") {
$this->redirect("Sign:in");
}
}