No route defined / 404 – Page not found
- ttrepper
- Member | 11
Hi all, I apologize for the inconvenience but somethow I don't get the routing – I cannot get it up and running. I guess there is a small issue but I don't find it. Any help appreciated. Thank you very much in advance. 😃
My setup is:
Folder
\index.php
\app\Bootstrap.php
\app\Modules\Front\Web\DefaultPresenter.php
\config\application.neon
in index I load the bootstrap:
App\Bootstrap::boot()
->createContainer()
->getByType(Nette\Application\Application::class)
->run();
in Bootstrap I do:
class Bootstrap {
public static function boot() : Configurator {
$appDir = dirname(__DIR__);
$configurator = new Configurator;
$configurator->setDebugMode(true); //$configurator->setDebugMode('secret@23.75.345.200');
$configurator->enableTracy($appDir . '/logs');
$configurator->setTempDirectory($appDir . '/temp');
$configurator->createRobotLoader()
->addDirectory(__DIR__)
->register();
$configurator->addConfig($appDir . '/config/application.neon');
//$configurator->addServices(['router' => new SimpleRouter('Web:Default:default')]);
$router = new RouteList;
//$router->addRoute('[<path .+>]', 'Web:Default:default'); //Catch-All ???
$router->addRoute('*', 'Web:Default:default'); //Class->Method
$configurator->addServices(['router' => $router]);
return $configurator;
}
}
My application.neon is:
application:
catchExceptions: true
mapping:
Web : App\Modules\Front\Web\*Presenter
routing:
debugger: true
//// Am I missing something here?
and my DefaultPresenter (is in app\modules\front\web\DefaultPresenter
class DefaultPresenter extends Nette\Application\UI\Presenter {
public function __construct() {
Debugger::log("A");
}
public function renderDefault() : void {
Debugger::log("B");
}
}
The error is a 404 – Page not found and Tracy say's “no route”.
What am I missing? How is case-sensitivity?
Can anbody point me to the right direction please? Thank you very much in advance. 😃
Thomas