Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Help block is not shown for a CheckboxType field #29135

Copy link
Copy link
Closed
@watlf

Description

@watlf
Issue body actions

Symfony version(s) affected: 4.1.0

Description
Help block is not shown for a CheckboxType field.

How to reproduce
Add some checkbox field in FormType

namespace App\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

class SomeCheckboxForm extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('name', TextType::class, [
            'label' => 'Name',
        ]);

        $builder->add('public', CheckboxType::class, array(
            'label'    => 'Public',
            'help' => 'message text',
        ));
    }
}

Create form in controller:

$checkbox = $this->createForm(SomeCheckboxForm::class)->createView();

And print it in view template:

    {{ form_start(checkbox) }}
    {{ form_widget(checkbox) }}
    {{ form_end(checkbox) }}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.