public function attributesstring (
        string $tagName, 
        array $attributes = [], 
        array $valid = [], 
        bool $prefixed = true) : self
    {
        foreach ($attributes as $name => $value) {
            if ($this->validate and sizeof($valid) > 0) {
                if (! in_array($name, $valid)) {
                    throw new Exception("Open Graph: Invalid attribute '{$name}' (unknown type)");
                }
            }

            $value = $this->convertDate($value);

            $this->tags[] = $this->createTag($tagName.':'.$name, $value, $prefixed);
        }

        return $this;
    }
public function attributesstring (
        string $tagName, 
        array $attributes = [], 
        array $valid = [], 
        bool $prefixed = true) : self
    {
        foreach ($attributes as $name => $value) {
            if ($this->validate and sizeof($valid) > 0) {
                if (! in_array($name, $valid)) {
                    throw new Exception("Open Graph: Invalid attribute '{$name}' (unknown type)");
                }
            }

            $value = $this->convertDate($value);

            $this->tags[] = $this->createTag($tagName.':'.$name, $value, $prefixed);
        }

        return $this;
    }
public function attributesstring ( string $ tagName , array $ attributes = [ ] , array $ valid = [ ] , bool $ prefixed = true ) : self { foreach ( $ attributes as $ name => $ value ) { if ( $ this -> validate and sizeof ( $ valid ) > 0 ) { if ( ! in_array ( $ name , $ valid ) ) { throw new Exception ( "Open Graph: Invalid attribute '{$name}' (unknown type)" ) ; } } $ value = $ this -> convertDate ( $ value ) ; $ this -> tags [ ] = $ this -> createTag ( $ tagName . ':' . $ name , $ value , $ prefixed ) ; } return $ this ; }
Adds attribute tags to the list of tags

@param string   $tagName    The name of the base tag
@param array    $attributes Array with attributes (pairs of name and value)
@param string[] $valid      Array with names of valid attributes
@param bool     $prefixed   Add the "og"-prefix?
@return OpenGraph
Adds attribute tags to the list of tags