english/libraries/joomla/form/form.php
/**
	 * Method to bind data to the form.
	 *
	 * @param   mixed  $data  An array or object of data to bind to the form.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   11.1
	 */
Method to bind data to the form.
@param   mixed  $data  An array or object of data to bind to the form.

@return  boolean  True on success.


Method to bind data to the form . @param mixed $data An array or object of data to bind to the form . @return boolean True on success .
public function bind($data)
	{
		if (!($this->xml instanceof JXMLElement)) {
			return false;
		}
		if (!is_object($data) && !is_array($data)) {
			return false;
		}
		if (is_object($data)) {
			if ($data instanceof JRegistry) {
				$data = $data->toArray();
			}
			else if ($data instanceof JObject) {
				$data = $data->getProperties();
			}
			else {
				$data = (array) $data;
			}
		}
		foreach ($data as $k => $v) {
			if ($this->findField($k)) {
				$this->data->set($k, $v);
			}
			else if (is_object($v) || JArrayHelper::isAssociative($v)) {
				$this->bindLevel($k, $v);
			}
		}
		return true;
	}
public function bind ( $ data ) { if ( ! ( $ this -> xml instanceof JXMLElement ) ) { return false ; } if ( ! is_object ( $ data ) && ! is_array ( $ data ) ) { return false ; } if ( is_object ( $ data ) ) { if ( $ data instanceof JRegistry ) { $ data = $ data -> toArray ( ) ; } else if ( $ data instanceof JObject ) { $ data = $ data -> getProperties ( ) ; } else { $ data = ( array ) $ data ; } } foreach ( $ data as $ k => $ v ) { if ( $ this -> findField ( $ k ) ) { $ this -> data -> set ( $ k , $ v ) ; } else if ( is_object ( $ v ) || JArrayHelper :: isAssociative ( $ v ) ) { $ this -> bindLevel ( $ k , $ v ) ; } } return true ; }
Method to bind data to the form.
Method to bind data to the form .
// Make sure there is a valid JForm XML document. // The data must be an object or array. // Convert the input to an array. // Handle a JRegistry. // Handle a JObject. // Handle other types of objects. // Process the input data. // If the field exists set the value. // If the value is an object or an associative array hand it off to the recursive bind level method.