Skip to content

Commit

Permalink
Fixed rendering of FileType (value is not a valid attribute for input…
Browse files Browse the repository at this point in the history
…[type=file])
  • Loading branch information
jalliot committed Nov 11, 2011
1 parent f8164ec commit e83e00a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Expand Up @@ -168,7 +168,7 @@
{% block field_widget %}
{% spaceless %}
{% set type = type|default('text') %}
<input type="{{ type }}" {{ block('widget_attributes') }} value="{{ value }}" />
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
{% endspaceless %}
{% endblock field_widget %}

Expand Down
@@ -1,5 +1,5 @@
<input
type="<?php echo isset($type) ? $view->escape($type) : "text" ?>"
value="<?php echo $view->escape($value) ?>"
<?php if (!empty($value)): ?>value="<?php echo $view->escape($value) ?>"<?php endif ?>
<?php echo $view['form']->renderBlock('attributes') ?>
/>
2 changes: 0 additions & 2 deletions tests/Symfony/Tests/Component/Form/AbstractLayoutTest.php
Expand Up @@ -1386,7 +1386,6 @@ public function testPassword()
'/input
[@type="password"]
[@name="na&me"]
[@value=""]
'
);
}
Expand Down Expand Up @@ -1419,7 +1418,6 @@ public function testPasswordWithMaxLength()
'/input
[@type="password"]
[@name="na&me"]
[@value=""]
[@maxlength="123"]
'
);
Expand Down

0 comments on commit e83e00a

Please sign in to comment.