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.
4
4
The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
5
5
and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
6
6
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
+
7
12
## [ 2.0.0] - 2017-12-11
8
13
### Added
9
14
- 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()
51
51
52
52
$ this ->assertXmlStringEqualsXmlString ($ expected , $ widget ->render ("name " , "option3 " ));
53
53
}
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
+ }
54
71
}
You can’t perform that action at this time.
0 commit comments