0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Symfony 入力フォームとボタンを縦並びでなくて横並びにしたい

Posted at

タイトル通りです。
form_widgetで一行で書くと縦に並びます。

before

XxxxxxxController.php
$form = $this->createFormBuilder()
    ->add('input', NumberType::class)
    ->add('search', SubmitType::class, ['label' => '検索する'])
    ->getForm();
index.html.twig
<div class="example-wrapper">
    {{ form_start(form) }}
    {{ form_widget(form) }}
    {{ form_end(form) }}
</div>

分けて書いたら横並びになりました。

after

index.html.twig
<div class="example-wrapper">
    {{ form_start(form) }}
    {{ form_widget(form.input) }}
    {{ form_widget(form.search) }}
    {{ form_end(form) }}
</div>

参考にさせていただきました

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?