PHP Класс FluentDOM\Loaders

The list is iterated until a valid document is returned by the loader
Наследование: implements IteratorAggregate, implements fluentdom\Loadable
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( array | Traversable $list = NULL ) Store the a list of loaders if provided.
add ( fluentdom\Loadable $loader ) Add a loader to the list
getIterator ( ) : Traversable Allow to iterate all added loaders
load ( mixed $source, string $contentType, array | Traversable | Options $options = [] ) : DOMDocument | Result | null Load a data source, the content type allows the loader to decide if it supports the data source
loadFragment ( mixed $source, string $contentType, array | Traversable | Options $options = [] ) : DOMDocumentFragment | null Load a data source as a fragment, the content type allows the loader to decide if it supports the data source
remove ( fluentdom\Loadable $loader ) Remove a loader to the list
supports ( string $contentType ) : boolean Validate if the list contains a loader that supports the given content type

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

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

Store the a list of loaders if provided.
public __construct ( array | Traversable $list = NULL )
$list array | Traversable

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

Add a loader to the list
public add ( fluentdom\Loadable $loader )
$loader fluentdom\Loadable

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

Allow to iterate all added loaders
public getIterator ( ) : Traversable
Результат Traversable

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

Load a data source, the content type allows the loader to decide if it supports the data source
public load ( mixed $source, string $contentType, array | Traversable | Options $options = [] ) : DOMDocument | Result | null
$source mixed
$contentType string
$options array | Traversable | Options
Результат DOMDocument | FluentDOM\Loader\Result | null

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

Load a data source as a fragment, the content type allows the loader to decide if it supports the data source
public loadFragment ( mixed $source, string $contentType, array | Traversable | Options $options = [] ) : DOMDocumentFragment | null
$source mixed
$contentType string
$options array | Traversable | Options
Результат DOMDocumentFragment | null

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

Remove a loader to the list
public remove ( fluentdom\Loadable $loader )
$loader fluentdom\Loadable

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

Validate if the list contains a loader that supports the given content type
public supports ( string $contentType ) : boolean
$contentType string
Результат boolean