PHP 클래스 Embera\Formatter

It outputs the oembed data as a custom string.
파일 보기 프로젝트 열기: mpratt/embera

보호된 프로퍼티들

프로퍼티 타입 설명
$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