projetAcoBDDv30.03.26
This commit is contained in:
35
projetphp/src/Domain/Pages/PagesController.php
Normal file
35
projetphp/src/Domain/Pages/PagesController.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Pages;
|
||||
|
||||
use App\Domain\Controller;
|
||||
use App\Infrastructure\View;
|
||||
|
||||
/**
|
||||
* Controller pour les pages sans lien avec un contenu spécifique.
|
||||
* Exemple : Page d'accueil.
|
||||
*/
|
||||
class PagesController extends Controller {
|
||||
|
||||
public static function defineRoutes(): array
|
||||
{
|
||||
return [
|
||||
self::Route( routeUrl: '/', routeName: 'home', routeAction: 'index', pageHeadTitle: "Home Page" ),
|
||||
self::Route( routeUrl: '/test/{int}/', routeName: 'test', routeAction: 'test' ),
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Route de la page d'accueil.
|
||||
* @return void
|
||||
*/
|
||||
public function index(): View {
|
||||
return new View( 'home', [ 'ok' => 'bla' ] );
|
||||
}
|
||||
|
||||
public function test( string $id ): void {
|
||||
echo "Coucou" . $id;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user