RichardsJoqvist\silverstripeEmbedder\Embedder
Extend {@link DataExtension} with methods to render embedded media from links in content
Synopsis
class Embedder
extends DataExtension
{
- // members
- private $width = NULL;
- private $height = NULL;
- private $maxWidth = NULL;
- private $maxHeight = NULL;
- private array $fields = ;
- private array $providers = ;
- private array $tags = ;
- private static array $dependencies = ;
- public CacheInterface $cache;
- // methods
- public string renderHTML()
- public array calculateSize()
- private bool|stdclass loadJson()
- public void contentcontrollerInit()
- private void convertToArray()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $dependencies
- $fields
—
array
Fields to execute embedder on - $height
—
int
Exact height of embedded media If set then media embedded from links will have this exact width. Media embedded from tags is not affected. - $maxHeight
—
int
Max height of embedded media - $maxWidth
—
int
Max width of embedded media - $providers
—
array
List of ClassNames that implement IEmbedderProvider - $width
—
int
Exact width of embedded media If set then media embedded from links will have this exact width. Media embedded from tags is not affected.
public
Methods
private
- convertToArray()
- loadJson() — Load oEmbed json and return it as stdclass object
public
- calculateSize() — Calculate embed size (maintaining aspect ratio)
- contentcontrollerInit() — Render embeds
- renderHTML() — Render HTML from oEmbed response