diff --git a/Documentation/team.puml b/Documentation/team.puml index b8374cd..a291b1d 100644 --- a/Documentation/team.puml +++ b/Documentation/team.puml @@ -12,12 +12,14 @@ class Team { } Team --> "- mainColor" Color -Team --> "- secondaryColor" Color +Team --> "- secondColor" Color class Color { - - value: int - - + getValue(): int + - value: string + - __construct(value : string) + + getValue(): string + + from(value: string): Color + + tryFrom(value : string) : ?Color } class TeamGateway{ @@ -31,15 +33,11 @@ TeamGateway *--"- con" Connexion TeamGateway ..> Color class TeamModel{ - + ERROR_INVALID_COLOR : int {readOnly} - + ERROR_INVALID_NAME : int {readOnly} - + ERROR_INVALID_PICTURE : int {readOnly} - + ERROR_INVALID_SEARCH : int {readOnly} - + ERROR_NO_DATA_FOUND : int {readOnly} --- + __construct(gateway : TeamGateway) + createTeam(name : string,picture : string, mainColorValue : int, secondColorValue : int, errors : array) + listByName(name : string ,errors : array) : ?array + + displayTeam(id : int): Team } TeamModel *--"- gateway" TeamGateway @@ -50,8 +48,11 @@ class TeamController{ - twig : Environement -- + __construct( model : TeamModel, twig : Environement) - + submitTeam(request : array) - + listTeamByName(request : array) + + displaySubmitTeam() : HttpResponse + + submitTeam(request : array) : HttpResponse + + displayListTeamByName(): HttpResponse + + listTeamByName(request : array) : HttpResponse + + displayTeam(id : int): HttpResponse } TeamController *--"- model" TeamModel @@ -62,7 +63,6 @@ class Connexion{ + __constructor(pdo : PDO) + exec(query : string, args : array) + fetch(query string, args array): array - } @enduml \ No newline at end of file diff --git a/src/Controller/TeamController.php b/src/Controller/TeamController.php index fa418c5..288e733 100644 --- a/src/Controller/TeamController.php +++ b/src/Controller/TeamController.php @@ -10,7 +10,7 @@ use App\Validation\FieldValidationFail; use App\Validation\Validators; use \Twig\Environment; -class TeamController /* verif si les camp sont assignés, sinon erreur 400*/ +class TeamController { private TeamModel $model; private Environment $twig; @@ -24,7 +24,7 @@ class TeamController /* verif si les camp sont assignés, sinon erreur 400*/ $this->twig = $twig; } - public function displaySubmitTeam() { + public function displaySubmitTeam() : HttpResponse { return ViewHttpResponse::twig("insert_team.html.twig", []); } diff --git a/src/Views/display_team.html.twig b/src/Views/display_team.html.twig index e3b0fe0..f7bb02b 100644 --- a/src/Views/display_team.html.twig +++ b/src/Views/display_team.html.twig @@ -1,32 +1,58 @@ - - - Twig view - - - - -

{{ team.name }}

-Logo d'équipe -
-
- -{% for m in team.members %} -

m.id

-{% endfor %} - - + + + Twig view + + + +
+

IQBall

+
+ +
+ +
+

{{ team.name }}

+ Logo d'équipe +
+
+ + {% for m in team.members %} +

m.id

+ {% endfor %} +
+ +
+ \ No newline at end of file