added the possibility to translate the placeholder and title attributes in the PHP form templates (refs #4194)

This commit is contained in:
Fabien Potencier 2012-05-22 12:23:06 +02:00
parent 5ca64b42fa
commit a6b3902128
2 changed files with 6 additions and 5 deletions

View File

@ -5,5 +5,6 @@ name="<?php echo $view->escape($full_name) ?>"
<?php if ($required): ?>required="required" <?php endif ?>
<?php if ($max_length): ?>maxlength="<?php echo $view->escape($max_length) ?>" <?php endif ?>
<?php if ($pattern): ?>pattern="<?php echo $view->escape($pattern) ?>" <?php endif ?>
<?php foreach ($attr as $k => $v) { printf('%s="%s" ', $view->escape($k), $view->escape($v)); } ?>
<?php foreach ($attr as $k => $v): ?>
<?php printf('%s="%s" ', $view->escape($k), $view->escape(in_array($v, array('placeholder', 'title')) ? $view['translator']->trans($v, array(), $translation_domain) : $v)) ?>
<?php endforeach; ?>