Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated for latest master

  • Loading branch information...
commit 4dab8baecbd856d572dd8e759ae1d276e0575f42 1 parent 722d544
@bakura10 bakura10 authored
View
12 library/Zend/Form/View/Helper/FormDateSelect.php
@@ -56,16 +56,16 @@ public function render(ElementInterface $element)
$monthsOptions = $this->getMonthsOptions($pattern['month']);
$yearOptions = $this->getYearsOptions($element->getMinYear(), $element->getMaxYear());
- if ($element->shouldCreateEmptyOption()) {
- $daysOptions = array('' => '') + $daysOptions;
- $monthsOptions = array('' => '') + $monthsOptions;
- $yearOptions = array('' => '') + $yearOptions;
- }
-
$dayElement = $element->getDayElement()->setValueOptions($daysOptions);
$monthElement = $element->getMonthElement()->setValueOptions($monthsOptions);
$yearElement = $element->getYearElement()->setValueOptions($yearOptions);
+ if ($element->shouldCreateEmptyOption()) {
+ $dayElement->setEmptyOption('');
+ $yearElement->setEmptyOption('');
+ $monthElement->setEmptyOption('');
+ }
+
$markup = array();
$markup[$pattern['day']] = $selectHelper->render($dayElement);
$markup[$pattern['month']] = $selectHelper->render($monthElement);
View
10 library/Zend/Form/View/Helper/FormMonthSelect.php
@@ -88,14 +88,14 @@ public function render(ElementInterface $element)
$monthsOptions = $this->getMonthsOptions($pattern['month']);
$yearOptions = $this->getYearsOptions($element->getMinYear(), $element->getMaxYear());
- if ($element->shouldCreateEmptyOption()) {
- $monthsOptions = array('' => '') + $monthsOptions;
- $yearOptions = array('' => '') + $yearOptions;
- }
-
$monthElement = $element->getMonthElement()->setValueOptions($monthsOptions);
$yearElement = $element->getYearElement()->setValueOptions($yearOptions);
+ if ($element->shouldCreateEmptyOption()) {
+ $monthElement->setEmptyOption('');
+ $yearElement->setEmptyOption('');
+ }
+
$markup = array();
$markup[$pattern['month']] = $selectHelper->render($monthElement);
$markup[$pattern['year']] = $selectHelper->render($yearElement);
Please sign in to comment.
Something went wrong with that request. Please try again.