[Form] Fixed missing label in button

This commit is contained in:
Bernhard Schussek 2013-04-22 16:22:02 +02:00
parent 4cbf3a1c97
commit 6671b32285
2 changed files with 2 additions and 4 deletions

View File

@ -1,4 +1,2 @@
<?php if (!$label) { $label = $view['form']->humanize($name); } ?>
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>>
<?php $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?>
</button>
<button type="<?php echo isset($type) ? $view->escape($type) : 'button' ?>" <?php echo $view['form']->block($form, 'button_attributes') ?>><?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></button>

View File

@ -1769,7 +1769,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
$form = $this->factory->createNamed('name', 'button');
$this->assertWidgetMatchesXpath($form->createView(), array(),
'/button[@type="button"][@name="name"]'
'/button[@type="button"][@name="name"][.="[trans]Name[/trans]"]'
);
}