Implemented form templates

This commit is contained in:
Kevin Frantz 2018-09-17 13:15:36 +02:00
parent 72ddc46712
commit a8781de51a
4 changed files with 16 additions and 2 deletions

View File

@ -2,11 +2,11 @@
namespace App\Form;
use App\Entity\User;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use App\Entity\NameSource;
class NameSourceType extends AbstractType
{
@ -18,7 +18,7 @@ class NameSourceType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => User::class,
'data_class' => NameSource::class,
]);
}
}

View File

@ -0,0 +1,3 @@
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}

View File

@ -0,0 +1,5 @@
{% extends "source/form/source.html.twig" %}
{% block content %}
<h1>{% trans %} Name {% endtrans %}</h1>
{% include "source/form/content/name." ~ app.request.requestFormat ~ ".twig" %}
{% endblock %}

View File

@ -0,0 +1,6 @@
{% extends "frames/default.html.twig" %}
{% block title %}
{% trans %}
Source
{% endtrans %}
{% endblock %}