public function attr($name, $value = null)
    {
        if ($value === null) {
            return $this->getAttribute($name);
        }

        return $this->setAttribute($name, $value);
    }
public function attr($name, $value = null)
    {
        if ($value === null) {
            return $this->getAttribute($name);
        }

        return $this->setAttribute($name, $value);
    }
public function attr ( $ name , $ value = null ) { if ( $ value === null ) { return $ this -> getAttribute ( $ name ) ; } return $ this -> setAttribute ( $ name , $ value ) ; }
Alias for getAttribute and setAttribute methods.

@param string $name The attribute name
@param string|null $value The attribute value or null if the attribute does not exist

@return string|null|\DiDom\Element
Alias for getAttribute and setAttribute methods .