To the point:
- I created new project on symfony 4.0: composer create-project symfony/skeleton sf4
- Welcome page is working
- I wanted to create my first page with https://symfony.com/doc/current/page_creation.html
and I did exactly what they say: create controller and route
- Welcome page changed status to: No route found for "GET /"
<-Solved
- new page path can't find file - Error 404
What am I doing wrong? That is silly
~src/Controller/SecurityController.php
<?php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
class SecurityController {
public function logowanie() {
return new Response(
'<html><body>Logowanie</body></html>'
);
}
}
~config/routes.yaml
index:
path: /
controller: App\Controller\MainController::index
logowanie:
path: /logowanie
controller: App\Controller\SecurityController::logowanie
EDIT:
Home page works - thanks @Cerad
/logowanie
path. If we trust documentation then it should works. – Invictus