Documentation

Oembed extends AutoService
in package

AutoService is a base-class for defining a service (in Civi's service-container).

Tags
service

oembed

Table of Contents

Properties

$defaultHeight  : int
$defaultWidth  : int
$maxPixels  : int
$minPixels  : int

Methods

create()  : array<string|int, mixed>
createLinkTags()  : string
findPropagatedParams()  : array<string|int, mixed>
Identify any query parameters that should be preserved/propagated to the equivalent oEmbed request.
getDefaultHeight()  : int
getDefaultWidth()  : int
isAllowedRoute()  : bool
Do we permit embedding of this route?
normalizeOptions()  : array<string|int, mixed>
applyPixelConstraint()  : int

Properties

$defaultHeight

private int $defaultHeight = 400

$defaultWidth

private int $defaultWidth = 600

$maxPixels

private int $maxPixels = 8000

$minPixels

private int $minPixels = 100

Methods

create()

public create(string $path[, array<string|int, mixed> $query = [] ][, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$path : string
$query : array<string|int, mixed> = []
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>

createLinkTags()

public createLinkTags(string $path[, array<string|int, mixed> $query = [] ][, array<string|int, mixed> $options = [] ]) : string
Parameters
$path : string
$query : array<string|int, mixed> = []
$options : array<string|int, mixed> = []

Ex: ['maxwidth' => '102']

Return values
string

findPropagatedParams()

Identify any query parameters that should be preserved/propagated to the equivalent oEmbed request.

public findPropagatedParams(array<string|int, mixed> $query) : array<string|int, mixed>

Note that support for this may vary by oEmbed client. When using <LINK>-based discovery, some clients (eg WordPress) may interject with their preferred value of url=XYZ.

Parameters
$query : array<string|int, mixed>
Return values
array<string|int, mixed>

getDefaultHeight()

public getDefaultHeight() : int
Return values
int

getDefaultWidth()

public getDefaultWidth() : int
Return values
int

isAllowedRoute()

Do we permit embedding of this route?

public isAllowedRoute(string $path) : bool
Parameters
$path : string
Return values
bool

normalizeOptions()

protected normalizeOptions(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed>
Return values
array<string|int, mixed>

applyPixelConstraint()

private applyPixelConstraint(mixed $value) : int
Parameters
$value : mixed
Return values
int

        
On this page

Search results