Skip to content

Commit

Permalink
getAttributes() can now return a string too (Alexey Borzov).
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.php.net/repository/pear/packages/HTML_Common/trunk@132534 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
golgote committed Jun 19, 2003
1 parent 5e1f1bf commit f71404d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,23 @@ function getAttribute($attr)
function setAttributes($attributes)
{
$this->_attributes = $this->_parseAttributes($attributes);
} // end func _setAttributes
} // end func setAttributes

/**
* Returns an assoc array of attributes
*
* Returns the assoc array (default) or string of attributes
*
* @param bool Whether to return the attributes as string
* @since 1.6
* @access public
* @return void
* @throws
* @return mixed attributes
*/
function getAttributes()
function getAttributes($asString = false)
{
return $this->_attributes;
if ($asString) {
return $this->_getAttrString($this->_attributes);
} else {
return $this->_attributes;
}
} //end func getAttributes

/**
Expand Down

0 comments on commit f71404d

Please sign in to comment.