mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Implemented form templates
This commit is contained in:
parent
72ddc46712
commit
a8781de51a
@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
3
application/templates/source/form/content/name.html.twig
Normal file
3
application/templates/source/form/content/name.html.twig
Normal file
@ -0,0 +1,3 @@
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
{{ form_end(form) }}
|
5
application/templates/source/form/name.html.twig
Normal file
5
application/templates/source/form/name.html.twig
Normal 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 %}
|
6
application/templates/source/form/source.html.twig
Normal file
6
application/templates/source/form/source.html.twig
Normal file
@ -0,0 +1,6 @@
|
||||
{% extends "frames/default.html.twig" %}
|
||||
{% block title %}
|
||||
{% trans %}
|
||||
Source
|
||||
{% endtrans %}
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user