EmbedProvider
in
Interface for classes that can provide embed HTML for a given URL.
Table of Contents
Methods
- getEmbedCodeFor() : string|null
- Provide the HTML code to embed the given URL in a web page.
Methods
getEmbedCodeFor()
Provide the HTML code to embed the given URL in a web page.
public
getEmbedCodeFor(string $url) : string|null
This should be a "safe" function in that, if the code cannot be retrieved for any reason (including exceptions, errors, blocked connections), it should return null.
Likewise, if a consumer receives null from this function, it should have a backup strategy available.
Parameters
- $url : string
-
URL to embed.
Return values
string|null —Embed code; null if code cannot be provided.