public function getAttribute($key)
    {
        if ( ! isset($this->attr[$key])) {
            return null;
        }
        $value = $this->attr[$key]['value'];
        if (is_string($value) && ! is_null($this->encode)) {
            // convert charset
            $this->attr[$key]['value'] = $this->encode->convert($value);
        }

        return $this->attr[$key];
    }
public function getAttribute($key)
    {
        if ( ! isset($this->attr[$key])) {
            return null;
        }
        $value = $this->attr[$key]['value'];
        if (is_string($value) && ! is_null($this->encode)) {
            // convert charset
            $this->attr[$key]['value'] = $this->encode->convert($value);
        }

        return $this->attr[$key];
    }
public function getAttribute ( $ key ) { if ( ! isset ( $ this -> attr [ $ key ] ) ) { return null ; } $ value = $ this -> attr [ $ key ] [ 'value' ] ; if ( is_string ( $ value ) && ! is_null ( $ this -> encode ) ) { // convert charset $ this -> attr [ $ key ] [ 'value' ] = $ this -> encode -> convert ( $ value ) ; } return $ this -> attr [ $ key ] ; }
Returns an attribute by the key

@param string $key
@return mixed
Returns an attribute by the key