src/Theme.php
public static function renderBlockAttrs(array $embed): string
    {
        // attributes to be rendered
        $classes = array();
        $styles = array();
        // shortcuts
        $d = &$embed['dimension'];
        // determine classes
        $classes[] = 'videoblock';
        if ($d->dynamic) {
            $classes[] = 'videoblock-dynamic';
        }
        // determine inline CSS style(s)
        // if scale model is no-scale, allow to "force dynamic"
        // by setting "dynamic" to TRUE
        if ($d->dynamic) {
            $styles[] = 'max-width:'.$d->width.'px';
        } else {
            $styles[] = 'width: '.$d->width.'px';
        }
        // render the attributes
        $class = implode(' ', $classes);
        $style = implode('; ', $styles) . (!empty($styles) ? ';' : '');
        return 'class="'.$class.'" style="'.$style.'"';
    }
public static function renderBlockAttrs(array $embed): string
    {
        // attributes to be rendered
        $classes = array();
        $styles = array();
        // shortcuts
        $d = &$embed['dimension'];
        // determine classes
        $classes[] = 'videoblock';
        if ($d->dynamic) {
            $classes[] = 'videoblock-dynamic';
        }
        // determine inline CSS style(s)
        // if scale model is no-scale, allow to "force dynamic"
        // by setting "dynamic" to TRUE
        if ($d->dynamic) {
            $styles[] = 'max-width:'.$d->width.'px';
        } else {
            $styles[] = 'width: '.$d->width.'px';
        }
        // render the attributes
        $class = implode(' ', $classes);
        $style = implode('; ', $styles) . (!empty($styles) ? ';' : '');
        return 'class="'.$class.'" style="'.$style.'"';
    }
public static function renderBlockAttrs ( array $ embed ) : string { // attributes to be rendered $ classes = array ( ) ; $ styles = array ( ) ; // shortcuts $ d = & $ embed [ 'dimension' ] ; // determine classes $ classes [ ] = 'videoblock' ; if ( $ d -> dynamic ) { $ classes [ ] = 'videoblock-dynamic' ; } // determine inline CSS style(s) // if scale model is no-scale, allow to "force dynamic" // by setting "dynamic" to TRUE if ( $ d -> dynamic ) { $ styles [ ] = 'max-width:' . $ d -> width . 'px' ; } else { $ styles [ ] = 'width: ' . $ d -> width . 'px' ; } // render the attributes $ class = implode ( ' ' , $ classes ) ; $ style = implode ( '; ' , $ styles ) . ( ! empty ( $ styles ) ? ';' : '' ) ; return 'class="' . $ class . '" style="' . $ style . '"' ; }
Helper funcion to template. Render attributes for .videoblock

@param array $embed embed definition

@return string HTTP attributes
Helper funcion to template . Render attributes for . videoblock