Prado\Xml\TXmlElement::getAttribute PHP Method

getAttribute() public method

public getAttribute ( $name ) : string
return string the attribute specified by the name, null if no such attribute
    public function getAttribute($name)
    {
        if ($this->_attributes !== null) {
            return $this->_attributes->itemAt($name);
        } else {
            return null;
        }
    }

Usage Example

Example #1
0
 public function testSetAttribute()
 {
     $element = new TXmlElement('tag');
     self::assertEquals(null, $element->getAttribute('key'));
     $element->setAttribute('key', 'value');
     self::assertEquals('value', $element->getAttribute('key'));
 }