Prev: DB_DataObject and multiple connections (DSNs)
Next: howto include comment in HTML_Flexy template
From: zia mohaddes on 3 Mar 2010 11:41 Hello everyone, I am currently using a class called HTML_QuickForm_date (/usr/share/php/HTML/QuickForm). And I would like to have an array appended to 'emptyOptiontext'. For example in my program I would like to use $arr = array("text1" => null, "text2" => "not_answered"); $config =& NDB_Config::singleton(); $this->dateOptions = array( 'language' => 'en', 'format' => 'YMd', 'minYear' => $config->getSetting('startYear'), 'maxYear' => $config->getSetting('endYear'), 'addEmptyOption' => true 'emptyOptionText' => $arr ); where array contains the the two text values which I want the 'emptyoptiontext' to represent. Hower when I do : $this->form->createElement("date","interview_start_date", null, $this->dateOptions); I get the word 'array' in the drop-down... I have looked at the date class in /usr/share/php/HTML/QuickForm and have noticed this line of code: if (is_array($this->_options['emptyOptionText']) && !empty($this->_options['emptyOptionText'][$sign])) { $options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText'][$sign]) + $options; which means that _options['emptyOptionText'] can be an array. So I am wondering if this class allows this functionality , if not what is the best way to make this happen, without having to write another class that does this.... I would highly appreciate if you could give me some feedback to how I could make this work using the given Quickform php date class.. thank you so much for your time in advance! regards,
|
Pages: 1 Prev: DB_DataObject and multiple connections (DSNs) Next: howto include comment in HTML_Flexy template |