PHP 클래스 Embera\Embera

파일 보기 프로젝트 열기: mpratt/embera 1 사용 예제들

보호된 프로퍼티들

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