Guides

YoutubeDirective extends BaseDirective
in package

FinalYes

This directive is used to embed a youtube video in the document.

Basic usage

  .. youtube:: dQw4w9WgXcQ

Options:

  • string title The title of the video
  • int width The width of the video, default is 560
  • int height The height of the video, default is 315
  • string allow The allow attribute of the iframe, default is 'encrypted-media; picture-in-picture; web-share'
  • bool allowfullscreen Whether the video should be allowed to go fullscreen, default is true

Table of Contents

Methods

getAliases()  : array<string|int, string>
Allow a directive to be registered under multiple names.
getName()  : string
Get the directive name
process()  : EmbeddedFrame
This is the function called by the parser to process the directive, it can be overloaded to do anything with the document, like tweaking nodes or change the parser context
processNode()  : Node
This can be overloaded to write a directive that just create one node for the document, which is common
optionsToArray()  : array<string, scalar|null>

Methods

getAliases()

Allow a directive to be registered under multiple names.

public getAliases() : array<string|int, string>

Aliases can be used for directives whose name has been deprecated or allows for multiple spellings.

Return values
array<string|int, string>

getName()

Get the directive name

public getName() : string
Return values
string

process()

This is the function called by the parser to process the directive, it can be overloaded to do anything with the document, like tweaking nodes or change the parser context

public process(BlockContext $blockContext, Directive $directive) : EmbeddedFrame

The node that directly follows the directive is also passed to it

Parameters
$blockContext : BlockContext

the current document context with the content of the directive

$directive : Directive

parsed directive containing options and variable

Return values
EmbeddedFrame

processNode()

This can be overloaded to write a directive that just create one node for the document, which is common

public processNode(BlockContext $blockContext, Directive $directive) : Node

The arguments are the same that process

Parameters
$blockContext : BlockContext
$directive : Directive
Return values
Node

optionsToArray()

protected optionsToArray(array<string|int, DirectiveOption$options) : array<string, scalar|null>
Parameters
$options : array<string|int, DirectiveOption>
Return values
array<string, scalar|null>

        
On this page

Search results