PHP Класс Embera\Providers\Facebook

Наследование: extends Embera\Adapters\Service
Показать файл Открыть проект

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

Свойство Тип Описание
$apiUrl inline {@inheritdoc} This Provider is kind of special, because it uses different oembed endpoints based on the given url. The default value of the endpoint is null and is set during the process of getting the url information.
$postPatterns Patterns that match posts urls
$videoPatterns Patterns that match video urls

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

Метод Описание
getInfo ( ) inline {@inheritdoc}

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

Метод Описание
modifyResponse ( array $response = [] ) inline {@inheritdoc}
urlMatchesPattern ( array $patternList ) : boolean Checks if $this->url matches the given list of patterns
validateUrl ( ) inline {@inheritdoc}

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

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

Im overriding this method because I need to set the endpoint based on the given url. By default we're always assuming it is a post url unless we have a specific video match. Why? Because we already did url validation and We dont want to loop over both sets of patterns all over again right? So we just need to loop over the smaller one ;)
public getInfo ( )

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

Need to modify the html response, to use the iframe instead. The html returned by facebook always adds the javascript code and the famous
. When embedding multiple links, the code seems to conflict and doesnt embed properly
protected modifyResponse ( array $response = [] )
$response array

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

Checks if $this->url matches the given list of patterns
protected urlMatchesPattern ( array $patternList ) : boolean
$patternList array Array with regex
Результат boolean

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

inline {@inheritdoc}
protected validateUrl ( )

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

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

inline {@inheritdoc} This Provider is kind of special, because it uses different oembed endpoints based on the given url. The default value of the endpoint is null and is set during the process of getting the url information.
protected $apiUrl

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

Patterns that match posts urls
protected $postPatterns

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

Patterns that match video urls
protected $videoPatterns