public function getAttribute($name, $default = null)
	{
		if ($this->element instanceof SimpleXMLElement)
		{
			$attributes = $this->element->attributes();

			// Ensure that the attribute exists
			if (property_exists($attributes, $name))
			{
				$value = $attributes->$name;

				if ($value !== null)
				{
					return (string) $value;
				}
			}
		}

		return $default;
	}
public function getAttribute($name, $default = null)
	{
		if ($this->element instanceof SimpleXMLElement)
		{
			$attributes = $this->element->attributes();

			// Ensure that the attribute exists
			if (property_exists($attributes, $name))
			{
				$value = $attributes->$name;

				if ($value !== null)
				{
					return (string) $value;
				}
			}
		}

		return $default;
	}
public function getAttribute ( $ name , $ default = null ) { if ( $ this -> element instanceof SimpleXMLElement ) { $ attributes = $ this -> element -> attributes ( ) ; // Ensure that the attribute exists if ( property_exists ( $ attributes , $ name ) ) { $ value = $ attributes -> $ name ; if ( $ value !== null ) { return ( string ) $ value ; } } } return $ default ; }
Method to get an attribute of the field

@param   string  $name     Name of the attribute to get
@param   mixed   $default  Optional value to return if attribute not found
@return  mixed             Value of the attribute / default
Method to get an attribute of the field