File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
src/TemplatePacks/templates/default Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
55and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
66
7+ ## [ 2.0.1] - 2017-12-11
8+ ### Changed
9+ - Loading ` Twig ` classes with psr-4 mode;
10+ - Select ` option ` tag don't render ` value ` if it is empty.
11+
712## [ 2.0.0] - 2017-12-11
813### Added
914 - Documentation of package;
Original file line number Diff line number Diff line change 1- < option value ="{{value|e}} "{% include 'attrs.html' with attrs %}> {{label|e}}</ option >
1+ < option {% if value is not empty %}value ="{{value|e}} "{% endif %} {% include 'attrs.html' with attrs %}> {{label|e}}</ option >
Original file line number Diff line number Diff line change @@ -51,4 +51,21 @@ public function testRenderOtherSelected()
5151
5252 $ this ->assertXmlStringEqualsXmlString ($ expected , $ widget ->render ("name " , "option3 " ));
5353 }
54+
55+ public function testRenderOptionWithouValue ()
56+ {
57+ $ widget = new Select ([
58+ "" => "" ,
59+ "option2 " => "option2 " ,
60+ "option3 " => "option3 " ,
61+ ]);
62+
63+ $ expected = '<select id="id_name" name="name"> ' .
64+ '<option></option> ' .
65+ '<option value="option2">option2</option> ' .
66+ '<option value="option3" selected="selected">option3</option> ' .
67+ '</select> ' ;
68+
69+ $ this ->assertXmlStringEqualsXmlString ($ expected , $ widget ->render ("name " , "option3 " ));
70+ }
5471}
You can’t perform that action at this time.
0 commit comments