projetAcoBDDv30.03.26
This commit is contained in:
42
projetphp/src/Http/Route.php
Normal file
42
projetphp/src/Http/Route.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
/**
|
||||
* Permet de définir une route précise.
|
||||
*/
|
||||
final class Route {
|
||||
|
||||
|
||||
public private(set) string $routeUrl;
|
||||
public private(set) string $routeName;
|
||||
public private(set) string $routeController;
|
||||
public private(set) string $routeAction;
|
||||
public private(set) array $routeMethods;
|
||||
public private(set) string $pageHeadTitle;
|
||||
|
||||
/**
|
||||
* @param string $routeUrl Le chemin vers la route.
|
||||
* @param string $routeName Le nom de la route.
|
||||
* @param string $routeController Le controller qui va interpréter cette route.
|
||||
* @param string $routeAction L'action du controller qui va interpréter cette route.
|
||||
* @param array $routeMethods Une liste de methodes GET, POST que la page accepte.
|
||||
* @param string $pageHeadTitle Le nom de la page qui sera affiché dans <title></title>.
|
||||
*/
|
||||
public function __construct(
|
||||
string $routeUrl,
|
||||
string $routeName,
|
||||
string $routeController,
|
||||
string $routeAction,
|
||||
array $routeMethods,
|
||||
string $pageHeadTitle,
|
||||
){
|
||||
$this->routeUrl = $routeUrl;
|
||||
$this->routeName = $routeName;
|
||||
$this->routeController = $routeController;
|
||||
$this->routeAction = $routeAction;
|
||||
$this->routeMethods = $routeMethods;
|
||||
$this->pageHeadTitle = $pageHeadTitle;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user