public function buildEmbedHtml(array $attributes = [], array $parameters = [])
    {
        // <iframe width="560" height="315" src="https://www.youtube.com/embed/5qanlirrRWs" frameborder="0" allowfullscreen></iframe>
        $attributes = array_merge($this->attributes, $attributes, [
            'src' => $this->buildEmbedUrl($parameters), // required attribute
        ]);

        $attributeStrings = [''];
        foreach ($attributes as $name => $value) {
            $attributeString = (string)$name;
            if (null !== $value) {
                $attributeString .= '="'.htmlspecialchars($value).'"';
            }
            $attributeStrings[] = $attributeString;
        }

        return '<iframe'.implode(' ', $attributeStrings).'></iframe>';
    }
public function buildEmbedHtml(array $attributes = [], array $parameters = [])
    {
        // <iframe width="560" height="315" src="https://www.youtube.com/embed/5qanlirrRWs" frameborder="0" allowfullscreen></iframe>
        $attributes = array_merge($this->attributes, $attributes, [
            'src' => $this->buildEmbedUrl($parameters), // required attribute
        ]);

        $attributeStrings = [''];
        foreach ($attributes as $name => $value) {
            $attributeString = (string)$name;
            if (null !== $value) {
                $attributeString .= '="'.htmlspecialchars($value).'"';
            }
            $attributeStrings[] = $attributeString;
        }

        return '<iframe'.implode(' ', $attributeStrings).'></iframe>';
    }
public function buildEmbedHtml ( array $ attributes = [ ] , array $ parameters = [ ] ) { // <iframe width="560" height="315" src="https://www.youtube.com/embed/5qanlirrRWs" frameborder="0" allowfullscreen></iframe> $ attributes = array_merge ( $ this -> attributes , $ attributes , [ 'src' => $ this -> buildEmbedUrl ( $ parameters ) , // required attribute ] ) ; $ attributeStrings = [ '' ] ; foreach ( $ attributes as $ name => $ value ) { $ attributeString = ( string ) $ name ; if ( null !== $ value ) { $ attributeString .= '="' . htmlspecialchars ( $ value ) . '"' ; } $ attributeStrings [ ] = $ attributeString ; } return '<iframe' . implode ( ' ' , $ attributeStrings ) . '></iframe>' ; }
Build the valid HTML code to embed this resource

@param array $attributes
@param array $parameters

@return string
Build the valid HTML code to embed this resource