PHP Класс Embera\Embera

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$config Configuration Settings
$errors Fetched errors
$oembed Instance of \Embera\Oembed
$providers Instance of \Embera\Providers
$urlEmbedRegex The pattern used to extract urls from a text when the embed:// prefix option is enabled
$urlRegex The pattern used to extract urls from a text

Открытые методы

Метод Описание
__construct ( array $config = [] ) : void Constructs the object and also instantiates the \Embera\Oembed Object and stores it into the $oembed properoty
addProvider ( string $host, string | object $class, array $params = [] ) : void Adds a new Provider into the service map
autoEmbed ( string $body = null ) : string Embeds known/available services into the given text.
getErrors ( ) : array Returns an array with all the errors
getLastError ( ) : string Gets the last error found
getUrlInfo ( string | array $body = null ) : array Finds all the information about a url (or a collection of urls)
hasErrors ( ) : boolean Checks if there were errors

Защищенные методы

Метод Описание
clean ( array $services = [] ) : array Strips invalid providers from the list
getProviders ( null | string | array $body = '' ) : array Finds all the valid urls inside the given text, compares which are allowed and returns an array with the detected providers

Описание методов

__construct() публичный Метод

Constructs the object and also instantiates the \Embera\Oembed Object and stores it into the $oembed properoty
public __construct ( array $config = [] ) : void
$config array
Результат void

addProvider() публичный Метод

Adds a new Provider into the service map
public addProvider ( string $host, string | object $class, array $params = [] ) : void
$host string The host for the map
$class string | object The class or object that should manage the provider
$params array Custom parameters that should be sent in the url for this Provider
Результат void

autoEmbed() публичный Метод

Embeds known/available services into the given text.
public autoEmbed ( string $body = null ) : string
$body string
Результат string

clean() защищенный Метод

Strips invalid providers from the list
protected clean ( array $services = [] ) : array
$services array
Результат array

getErrors() публичный Метод

Returns an array with all the errors
public getErrors ( ) : array
Результат array

getLastError() публичный Метод

Gets the last error found
public getLastError ( ) : string
Результат string

getProviders() защищенный Метод

Finds all the valid urls inside the given text, compares which are allowed and returns an array with the detected providers
protected getProviders ( null | string | array $body = '' ) : array
$body null | string | array An array or string with Urls
Результат array

getUrlInfo() публичный Метод

Finds all the information about a url (or a collection of urls)
public getUrlInfo ( string | array $body = null ) : array
$body string | array An array or string with urls
Результат array

hasErrors() публичный Метод

Checks if there were errors
public hasErrors ( ) : boolean
Результат boolean

Описание свойств

$config защищенное свойство

Configuration Settings
protected $config

$errors защищенное свойство

Fetched errors
protected $errors

$oembed защищенное свойство

Instance of \Embera\Oembed
protected $oembed

$providers защищенное свойство

Instance of \Embera\Providers
protected $providers

$urlEmbedRegex защищенное свойство

The pattern used to extract urls from a text when the embed:// prefix option is enabled
protected $urlEmbedRegex

$urlRegex защищенное свойство

The pattern used to extract urls from a text
protected $urlRegex