PHP Класс Embera\Formatter

It outputs the oembed data as a custom string.
Показать файл Открыть проект

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

Свойство Тип Описание
$allowOffline Wether or not to allow offline responses
$embera Instance of \Embera\Embera
$errors Fetched errors
$template The template with placeholders to be replaced with the data from an ombed response

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

Метод Описание
__call ( string $method, array $args ) : mixed Truly decorate the embera object. With this method Im preserving compatability with the API of the decorated object.
__construct ( Embera $embera, boolean $allowOffline = false ) : void Constructor
getErrors ( ) : array Returns an array with all the errors
getLastError ( ) : string Gets the last error found
hasErrors ( ) : boolean Checks if there were errors
setTemplate ( string $template, string | array $body = null ) : string Sets a template with placeholders, that should be replaced by the data from an oembed response.
transform ( string | array $body = null ) : string This method transforms an array or a string with urls into another string using a specified template.

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

Метод Описание
replace ( array $data, string $template, string $prefix = null ) : string Replaces the given $data inside the $template

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

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

Truly decorate the embera object. With this method Im preserving compatability with the API of the decorated object.
public __call ( string $method, array $args ) : mixed
$method string
$args array
Результат mixed

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

Constructor
public __construct ( Embera $embera, boolean $allowOffline = false ) : void
$embera Embera Instance of \Embera\Embera
$allowOffline boolean Wether or not to allow offline embera
Результат void

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

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

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

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

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

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

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

Replaces the given $data inside the $template
protected replace ( array $data, string $template, string $prefix = null ) : string
$data array
$template string
$prefix string
Результат string

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

Sets a template with placeholders, that should be replaced by the data from an oembed response.
public setTemplate ( string $template, string | array $body = null ) : string
$template string
$body string | array An array or string with Urls
Результат string

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

This method transforms an array or a string with urls into another string using a specified template.
public transform ( string | array $body = null ) : string
$body string | array An array or string with Urls
Результат string

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

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

Wether or not to allow offline responses
protected $allowOffline

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

Instance of \Embera\Embera
protected $embera

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

Fetched errors
protected $errors

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

The template with placeholders to be replaced with the data from an ombed response
protected $template