Skip to content

Commit

Permalink
[4-11] フォーム要素を個別に表示
Browse files Browse the repository at this point in the history
  • Loading branch information
hidenorigoto committed Nov 4, 2015
1 parent f3ec4c3 commit 76ca852
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 1 deletion.
43 changes: 42 additions & 1 deletion app/Resources/views/Inquiry/index.html.twig
Expand Up @@ -16,7 +16,48 @@
<section id="inquiry-sec">
<div class="container">
<div class="row pad-row">
{{ form(form) }}
{{ form_start(form) }}
<table class="table">
<tr>
<th><i class="fa fa-circle"></i> お名前</th>
<td>
{{ form_widget(form.name, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.name) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle"></i> メールアドレス</th>
<td>
{{ form_widget(form.email, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.email) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle-o"></i> 電話番号</th>
<td>
{{ form_widget(form.tel, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.tel) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle"></i> お問い合わせ種別</th>
<td>
{{ form_widget(form.type, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.type) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle"></i> お問い合わせ内容</th>
<td>
{{ form_widget(form.content, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.content) }}
</td>
</tr>
</table>
<div class="text-center">
{{ form_widget(form.submit, {"attr": {"class":"btn btn-primary"}}) }}
</div>
{{ form_end(form) }}
</div>
</div>
</section>
Expand Down
44 changes: 44 additions & 0 deletions docs/lists/ch04/04-11.txt
@@ -0,0 +1,44 @@
<div class="row pad-row">
{{ form_start(form) }}
<table class="table">
<tr>
<th><i class="fa fa-circle"></i> お名前</th>
<td>
{{ form_widget(form.name, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.name) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle"></i> メールアドレス</th>
<td>
{{ form_widget(form.email, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.email) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle-o"></i> 電話番号</th>
<td>
{{ form_widget(form.tel, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.tel) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle"></i> お問い合わせ種別</th>
<td>
{{ form_widget(form.type, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.type) }}
</td>
</tr>
<tr>
<th><i class="fa fa-circle"></i> お問い合わせ内容</th>
<td>
{{ form_widget(form.content, {"attr": {"class":"form-control"}}) }}
{{ form_errors(form.content) }}
</td>
</tr>
</table>
<div class="text-center">
{{ form_widget(form.submit, {"attr": {"class":"btn btn-primary"}}) }}
</div>
{{ form_end(form) }}
</div>

0 comments on commit 76ca852

Please sign in to comment.