Following _build function comes from Zend/View/Helper/FormSelect.php file.
For the 
if (in_array((string)$value, $selected,true )){...}, we better cast $value
as a string and put true as the argument when calling php in_array function.
That can handle the 0 as both string and integer.



 protected function _build($value, $label, $selected)
    {
        $opt = '<option'
             . ' value="' . $this->view->escape($value) . '"'
             . ' label="' . $this->view->escape($label) . '"';

        // selected?
        if (in_array((string)$value, $selected,true )) {
            $opt .= ' selected="selected"';
        }

        $opt .= '>' . $this->view->escape($label) . "</option>";

        return $opt;
    }

}

-- 
View this message in context: 
http://www.nabble.com/Zend-View-Helper-FormSelect.php-tp14517826s16154p14517826.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to