FrameworkBundle Tests
This commit is contained in:
parent
4f2581d7da
commit
ba798dfdf4
@ -0,0 +1,3 @@
|
||||
<?php if (!empty($help)): ?>
|
||||
<p class="help-text"><?php echo $view->escape(false !== $translation_domain ? $view['translator']->trans($help, array(), $translation_domain) : $help) ?></p>
|
||||
<?php endif ?>
|
@ -2,4 +2,5 @@
|
||||
<?php echo $view['form']->label($form) ?>
|
||||
<?php echo $view['form']->errors($form) ?>
|
||||
<?php echo $view['form']->widget($form) ?>
|
||||
<?php echo $view['form']->help($form); ?>
|
||||
</div>
|
||||
|
@ -5,5 +5,6 @@
|
||||
<td>
|
||||
<?php echo $view['form']->errors($form); ?>
|
||||
<?php echo $view['form']->widget($form); ?>
|
||||
<?php echo $view['form']->help($form); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -169,6 +169,19 @@ class FormHelper extends Helper
|
||||
return $this->renderer->searchAndRenderBlock($view, 'label', $variables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the help of the given view.
|
||||
*
|
||||
* @param FormView $view The parent view
|
||||
* @param array $variables An array of variables
|
||||
*
|
||||
* @return string The HTML markup
|
||||
*/
|
||||
public function help(FormView $view, array $variables = array())
|
||||
{
|
||||
return $this->renderer->searchAndRenderBlock($view, 'help', $variables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the errors of the given view.
|
||||
*
|
||||
|
@ -91,6 +91,11 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest
|
||||
return (string) $this->engine->get('form')->label($view, $label, $vars);
|
||||
}
|
||||
|
||||
protected function renderHelp(FormView $view, array $vars = array())
|
||||
{
|
||||
return (string) $this->engine->get('form')->help($view);
|
||||
}
|
||||
|
||||
protected function renderErrors(FormView $view)
|
||||
{
|
||||
return (string) $this->engine->get('form')->errors($view);
|
||||
|
@ -92,6 +92,11 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest
|
||||
return (string) $this->engine->get('form')->label($view, $label, $vars);
|
||||
}
|
||||
|
||||
protected function renderHelp(FormView $view, array $vars = array())
|
||||
{
|
||||
return (string) $this->engine->get('form')->help($view);
|
||||
}
|
||||
|
||||
protected function renderErrors(FormView $view)
|
||||
{
|
||||
return (string) $this->engine->get('form')->errors($view);
|
||||
|
Reference in New Issue
Block a user