Nedari se mi preskocit login
- asinkan
- Člen | 38
Ahoj,
zacal jsem upravovat jeden priklad s databazi alb. Na zacatku je tam logovani uzivatele. Ted to ale chci preskocit a chci rovnou skocit na šablonu …/Dashboard/default.latte
V index.php je neco cemu nerozumim, ale odkazuje to na $container = require __DIR__ . ‚/../app/bootstrap.php‘;
OK, jdu do dalsi veci,kterej nerozumim, bootstrap.php
<?php
<?php
use Nette\Application\Routers\Route;
use Nette\Application\Routers\SimpleRouter;
// Load Nette Framework
if (@!include __DIR__ . '/../../../Nette/loader.php') {
die('Install Nette using `composer update`');
}
// Configure application
$configurator = new Nette\Configurator;
// Enable Tracy for error visualisation & logging
$configurator->enableTracy(__DIR__ . '/../log');
// Enable RobotLoader - this will load all classes automatically
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
->addDirectory(__DIR__)
->register();
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config.neon');
$container = $configurator->createContainer();
// Setup router using mod_rewrite detection
if (function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules(), true)) {
$router = $container->getByType(Nette\Application\IRouter::class);
$router[] = new Route('index.php', 'Dashboard:default', Route::ONE_WAY);
$router[] = new Route('<presenter>/<action>[/<id>]', 'Dashboard:default');
} else {
$container->addService('router', new SimpleRouter('Dashboard:default'));
}
return $container;
?>
Jsou tam radky
$router[] = new Route(‚index.php‘, ‚Dashboard:default‘,
Route::ONE_WAY);
$router[] = new Route(‚<presenter>/<action>[/<id>]‘,
‚Dashboard:default‘);
Tak proc se to snazi pripojit na template SignPresenter.php ?
Dik
Editoval asinkan (8. 2. 2018 17:06)
- David Matějka
- Moderator | 6445
predpokladam, ze v dashboard presenteru (nebo v nejakem base presenteru, od ktereho to dedi) bude kontrola opravneni a nasledne presmerovani na login stranku