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