コード例 #1
0
	public function get($key) {
		if ($key == 'value' && sizeof($this->_attributes['options']) > 1) {
			// This should return an array if there are more than 1 option.
			if(!isset($this->_attributes['value'])) return array();
			elseif (!$this->_attributes['value']) return array();
			else return $this->_attributes['value'];
		}
		else {
			return parent::get($key);
		}
	}
コード例 #2
0
 /**
  * Get a requested attribute from this form element.
  *
  * @param string $key The key of the attribute to retrieve
  *
  * @return GeoAddressModel|null|string
  */
 public function get($key)
 {
     if ($key == 'value') {
         if (!$this->_model) {
             $this->_model = new GeoAddressModel();
         }
         return $this->_model;
     } else {
         return parent::get($key);
     }
 }