Skip to content

Commit

Permalink
[4-12] お問い合わせフォーム定義メソッド
Browse files Browse the repository at this point in the history
  • Loading branch information
hidenorigoto committed Nov 4, 2015
1 parent 76ca852 commit 397650c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/lists/ch04/04-12.txt
@@ -0,0 +1,21 @@
private function createInquiryForm()
{
return $this->createFormBuilder()
->add('name', 'text')
->add('email', 'text')
->add('tel', 'text', [
'required' => false,
])
->add('type', 'choice', [
'choices' => [
'公演について',
'その他',
],
'expanded' => true,
])
->add('content', 'textarea')
->add('submit', 'submit', [
'label' => '送信',
])
->getForm();
}
22 changes: 22 additions & 0 deletions src/AppBundle/Controller/InquiryController.php
Expand Up @@ -40,4 +40,26 @@ public function indexAction()
['form' => $form->createView()]
);
}

private function createInquiryForm()
{
return $this->createFormBuilder()
->add('name', 'text')
->add('email', 'text')
->add('tel', 'text', [
'required' => false,
])
->add('type', 'choice', [
'choices' => [
'公演について',
'その他',
],
'expanded' => true,
])
->add('content', 'textarea')
->add('submit', 'submit', [
'label' => '送信',
])
->getForm();
}
}

0 comments on commit 397650c

Please sign in to comment.