diff --git a/src/Form/IncidentType.php b/src/Form/IncidentType.php new file mode 100644 index 0000000..9bee257 --- /dev/null +++ b/src/Form/IncidentType.php @@ -0,0 +1,33 @@ +add('description', + TextareaType::class) + ->add('employee', EntityType::class, ['class' => Employee::class, 'choice_label' => 'firstname']) +// ->add('incidentType', EntityType::class, ['class' => IncidentType::class, 'choice_label' => 'id']) + ->add('Enregistrer', SubmitType::class) + ; + } + + public function configureOptions(OptionsResolver $resolver): void + { + $resolver->setDefaults([ + // Configure your form options here + ]); + } +} diff --git a/templates/incident/index.html.twig b/templates/incident/index.html.twig new file mode 100644 index 0000000..58bbe65 --- /dev/null +++ b/templates/incident/index.html.twig @@ -0,0 +1,30 @@ +{% extends 'base.html.twig' %} + +{% block title %}Incident index{% endblock %} + +{% block body %} +

Incident index

+ + + + + + + + + + {% for incident in incidents %} + + + + + + {% endfor %} + +
IdDescription
{{ incident.id }}{{ incident.description }} + show + edit +
+ + Create new +{% endblock %} diff --git a/templates/incident/new.html.twig b/templates/incident/new.html.twig new file mode 100644 index 0000000..18ff4c1 --- /dev/null +++ b/templates/incident/new.html.twig @@ -0,0 +1,11 @@ +{% extends 'base.html.twig' %} + +{% block title %}New Incident{% endblock %} + +{% block body %} +

Create new Incident

+ + {{ form(formNew,{'attr': {'novalidate': 'novalidate'}}) }} + + back to list +{% endblock %}