JoshyPHP Can you show me how can I make new event?
I read your document (http://s9etextformatter.readthedocs.io/Plugins/MediaEmbed/Synopsis/) but I have no idea about where will below code be put
$configurator = new s9e\TextFormatter\Configurator;
$configurator->MediaEmbed->add(
'youtube',
[
'host' => 'youtube.com',
'extract' => "!youtube\\.com/watch\\?v=(?'id'[-\\w]+)!",
'iframe' => [
'width' => 560,
'height' => 315,
'src' => 'http://www.youtube.com/embed/{@id}'
]
]
);
// Get an instance of the parser and the renderer
extract($configurator->finalize());
$text = 'http://www.youtube.com/watch?v=-cEzsCAzTak';
$xml = $parser->parse($text);
$html = $renderer->render($xml);
echo $html;
Many thanks.