Skip to content

Kirby 5.0.2

Html::youtube()

Embeds a YouTube video by URL in an <iframe>

Html::youtube(string $url, array $options = [ ], array $attr = [ ]): string|null

Parameters

Name Type Default Description
$urlrequired string no default value YouTube video URL
$options array [ ] Query params for the embed URL
$attr array [ ] Additional attributes for the <iframe> tag

Return types

stringornull

The generated HTML

Parent class

Kirby\Toolkit\Html