Skip to content

Commit

Permalink
bug #20934 [FrameworkBundle] Fix PHP form templates on translatable a…
Browse files Browse the repository at this point in the history
…ttributes (ro0NL)

This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix PHP form templates on translatable attributes

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #20365 (comment)
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

Separated from #20365

Commits
-------

10806e0 [FrameworkBundle] Fix PHP form templates on translatable attributes
  • Loading branch information
fabpot committed Dec 17, 2016
2 parents a2c2d15 + 10806e0 commit 2344c22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -1,6 +1,6 @@
id="<?php echo $view->escape($id) ?>" name="<?php echo $view->escape($full_name) ?>" <?php if ($disabled): ?>disabled="disabled" <?php endif ?>
<?php foreach ($attr as $k => $v): ?>
<?php if (in_array($v, array('placeholder', 'title'), true)): ?>
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
<?php printf('%s="%s" ', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
<?php elseif ($v === true): ?>
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
Expand Down
@@ -1,6 +1,6 @@
<?php if (!empty($id)): ?>id="<?php echo $view->escape($id) ?>" <?php endif ?>
<?php foreach ($attr as $k => $v): ?>
<?php if (in_array($v, array('placeholder', 'title'), true)): ?>
<?php if (in_array($k, array('placeholder', 'title'), true)): ?>
<?php printf('%s="%s" ', $view->escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
<?php elseif ($v === true): ?>
<?php printf('%s="%s" ', $view->escape($k), $view->escape($k)) ?>
Expand Down

0 comments on commit 2344c22

Please sign in to comment.