This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Allow to create empty option in Select #2288
Merged
weierophinney
merged 16 commits into
zendframework:master
from
bakura10:form/create-empty-option
Sep 10, 2012
Merged
Allow to create empty option in Select #2288
weierophinney
merged 16 commits into
zendframework:master
from
bakura10:form/create-empty-option
Sep 10, 2012
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP response should accept status line with zero length reasen phrase.
…join, Added unit test, fixed typo's in unit test
This does not give the required result. It gives the isset result which is a boolean true or false. (isset($this->attributes['min'])) ?: 0 This does work. It adds the value as expected. (isset($this->attributes['min'])) ? $this->attributes['min'] : 0,
…pieters-hotfix/ZF2-514
Same issue as with zendframework#2293 It passes the value of isset and not the min/step attribute.
Notifications now to #zftalk.dev
…to form/create-empty-option
@@ -96,6 +104,10 @@ public function setOptions($options) | |||
$this->setValueOptions($this->options['options']); | |||
} | |||
|
|||
if (isset($this->options['create_empty_option'])) { | |||
$this->setShouldCreateEmptyOption($this->options['create_empty_option']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this method in the class, and looking at the tests, this line would never get exercised. Can you please test this permutation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. My mistake !
ghost
assigned weierophinney
Sep 10, 2012
Excellent, thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DOES NOT break BC.
This PR adds an option to every Select element in order to automatically prepend an empty option to a select element. This is useful either in a user experience point of view, but most often because a lot of JavaScript libraries need an empty option to render, for instance, a placeholder value.
EDIT : it now instead allows to specify a string for the empty option. This string will be used as the label for the empty option, but without any value. This is by far more flexible as it allows to set either an empty string or a kind of placeholder.