Form types
parent
e647714baf
commit
8d9b89d73d
|
@ -7,14 +7,13 @@ use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use ApiPlatform\Core\Annotation\ApiResource;
|
use ApiPlatform\Core\Annotation\ApiResource;
|
||||||
use ApiPlatform\Core\Annotation\ApiSubresource;
|
use ApiPlatform\Core\Annotation\ApiSubresource;
|
||||||
use App\Service\QuestionAPI;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ApiResource(
|
* @ApiResource(
|
||||||
* collectionOperations={"get"={"method"="GET"}},
|
* collectionOperations={"get"={"method"="GET"}},
|
||||||
* itemOperations={
|
* itemOperations={
|
||||||
* "get"={"method"="GET"},
|
* "get"={"method"="GET"},
|
||||||
* "special"={"route_name"="api_questions_first", "requirements"={}}
|
* "special"={"route_name"="api_questions_first"}
|
||||||
* }
|
* }
|
||||||
* )
|
* )
|
||||||
* @ORM\Table(name="question")
|
* @ORM\Table(name="question")
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Form;
|
namespace App\Form;
|
||||||
|
|
||||||
use App\Entity\Question;
|
use App\Entity\Question;
|
||||||
|
use Doctrine\DBAL\Types\TextType;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
@ -12,8 +13,12 @@ class QuestionType extends AbstractType
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('text')
|
->add('text', null, [
|
||||||
->add('sticker')
|
'attr' => ['class' => 'form-control'],
|
||||||
|
])
|
||||||
|
->add('sticker', null, [
|
||||||
|
'attr' => ['class' => 'form-control'],
|
||||||
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,15 @@ class ResponseType extends AbstractType
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
$builder
|
$builder
|
||||||
->add('text')
|
->add('text', null, [
|
||||||
->add('question')
|
'attr' => ['class' => 'form-control'],
|
||||||
->add('child')
|
])
|
||||||
|
->add('question', null, [
|
||||||
|
'attr' => ['class' => 'form-control'],
|
||||||
|
])
|
||||||
|
->add('child', null, [
|
||||||
|
'attr' => ['class' => 'form-control'],
|
||||||
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue