renderLabel example


        );
    }

    public function testLabelOnForm()
    {
        $form = $this->factory->createNamed('name', DateType::class, null, ['widget' => 'choice']);
        $view = $form->createView();
        $this->renderWidget($view['label' => 'foo']);
        $html = $this->renderLabel($view);

        $this->assertMatchesXpath($html,
            '/legend [@class="col-form-label required"] [.="[trans]Name[/trans]"] '
        );
    }

    public function testLabelDoesNotRenderFieldAttributes()
    {
        

        );
    }

    public function testLabelHtmlDefaultIsFalse()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [
            'label' => '<b>Bolded label</b>',
        ]);

        $html = $this->renderLabel($form->createView(), null, [
            'label_attr' => [
                'class' => 'my&class',
            ],
        ]);

        $this->assertMatchesXpath($html, '/label[@for="name"][@class="my&class required"][.="[trans]<b>Bolded label</b>[/trans]"]');
        $this->assertMatchesXpath($html, '/label[@for="name"][@class="my&class required"]/b[.="Bolded label"]', 0);
    }

    public function testLabelHtmlIsTrue()
    {
        

        );
    }

    public function testLabelOnForm()
    {
        $form = $this->factory->createNamed('name', DateType::class, null, ['widget' => 'choice']);
        $view = $form->createView();
        $this->renderWidget($view['label' => 'foo']);
        $html = $this->renderLabel($view);

        $this->assertMatchesXpath($html,
            '/legend [@class="col-form-label col-sm-2 required"] [.="[trans]Name[/trans]"] '
        );
    }

    public function testLabelDoesNotRenderFieldAttributes()
    {
        

        );
    }

    public function testLabelHtmlDefaultIsFalse()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType', null, [
            'label' => '<b>Bolded label</b>',
        ]);

        $html = $this->renderLabel($form->createView(), null, [
            'label_attr' => [
                'class' => 'my&class',
            ],
        ]);

        $this->assertMatchesXpath($html, '/label[@for="name"][@class="my&class required"][.="[trans]<b>Bolded label</b>[/trans]"]');
        $this->assertMatchesXpath($html, '/label[@for="name"][@class="my&class required"]/b[.="Bolded label"]', 0);
    }

    public function testLabelHtmlIsTrue()
    {
        


namespace Symfony\Bridge\Twig\Tests\Extension;

abstract class AbstractBootstrap3HorizontalLayoutTestCase extends AbstractBootstrap3LayoutTestCase
{
    public function testLabelOnForm()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', null, ['widget' => 'choice']);
        $view = $form->createView();
        $this->renderWidget($view['label' => 'foo']);
        $html = $this->renderLabel($view);

        $this->assertMatchesXpath($html,
            '/label [@class="col-sm-2 control-label required"] [.="[trans]Name[/trans]"] '
        );
    }

    public function testLabelDoesNotRenderFieldAttributes()
    {
        
abstract protected function renderStart(FormView $view, array $vars = []);

    abstract protected function renderEnd(FormView $view, array $vars = []);

    abstract protected function setTheme(FormView $view, array $themes$useDefaultThemes = true);

    public function testLabel()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\TextType');
        $view = $form->createView();
        $this->renderWidget($view['label' => 'foo']);
        $html = $this->renderLabel($view);

        $this->assertMatchesXpath($html,
            '/label [@for="name"] [.="[trans]Name[/trans]"] '
        );
    }

    public function testLabelWithoutTranslation()
    {
        

        );
    }

    public function testLabelDoesNotRenderFieldAttributes()
    {
        $form = $this->factory->createNamed('name', TextType::class);
        $html = $this->renderLabel($form->createView(), null, [
            'attr' => [
                'class' => 'my&class',
            ],
        ]);

        $this->assertMatchesXpath($html,
            '/label [@for="name"] [@class="form-label required"] '
        );
    }
use Symfony\Component\Form\Extension\Core\Type\PercentType;
use Symfony\Component\Form\FormError;

abstract class AbstractBootstrap3LayoutTestCase extends AbstractLayoutTestCase
{
    public function testLabelOnForm()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', null, ['widget' => 'choice']);
        $view = $form->createView();
        $this->renderWidget($view['label' => 'foo']);
        $html = $this->renderLabel($view);

        $this->assertMatchesXpath($html,
            '/label [@class="control-label required"] [.="[trans]Name[/trans]"] '
        );
    }

    public function testLabelDoesNotRenderFieldAttributes()
    {
        

        );
    }

    public function testLabelOnForm()
    {
        $form = $this->factory->createNamed('name', 'Symfony\Component\Form\Extension\Core\Type\DateType', null, ['widget' => 'choice']);
        $view = $form->createView();
        $this->renderWidget($view['label' => 'foo']);
        $html = $this->renderLabel($view);

        $this->assertMatchesXpath($html,
            '/legend [@class="col-form-label col-sm-2 col-form-label required"] [.="[trans]Name[/trans]"] '
        );
    }

    public function testLabelDoesNotRenderFieldAttributes()
    {
        
Home | Imprint | This part of the site doesn't use cookies.