diff --git a/config.yaml b/config.yaml index cf44823..d4706b2 100644 --- a/config.yaml +++ b/config.yaml @@ -14,5 +14,5 @@ services: # resource: 'services/*' # Allows to use controllers as services - # YesWiki\MeeO\Controller\: - # resource: 'controllers/*' + YesWiki\MeeO\Controller\: + resource: 'controllers/*' diff --git a/controllers/ApiController.php b/controllers/ApiController.php new file mode 100644 index 0000000..3ee2f75 --- /dev/null +++ b/controllers/ApiController.php @@ -0,0 +1,38 @@ +getContent(); + + parse_str($content, $parameters); + + $result = []; + + foreach ($parameters as $cle => $valeur) { + $clef_action = explode('_', $cle); + if ($clef_action[1] == 'classe' && $valeur != 'aucune') { + $result[] = 'Change la classe de '.$clef_action[0].' pour '.$valeur; + } + if ($clef_action[1] == 'del') { + $result[] = 'Suppression de '.$clef_action[0]; + } + } + + return new ApiResponse( + ['result'=> $result], + Response::HTTP_CREATED + ); + } +} \ No newline at end of file diff --git a/templates/edu_eleves.twig b/templates/edu_eleves.twig index e33f579..d38e3c8 100644 --- a/templates/edu_eleves.twig +++ b/templates/edu_eleves.twig @@ -4,9 +4,9 @@

Classe

-
+ {% for eleve in eleves|sort %} -
+
{{ eleve['bf_nom'] }}
- +
{% endfor %}