PHP Class FluentDOM\Loader\Lazy

Inheritance: implements FluentDOM\Loadable
Datei anzeigen Open project: fluentdom/fluentdom

Public Methods

Method Description
__construct ( array $loaders = [] )
add ( string $contentType, FluentDOM\Loadable | callable $loader ) Add a loader to the list
addClasses ( array[] $classes, string $namespace = '' ) Add loader classes for different types
get ( string $contentType ) : boolean | FluentDOM\Loadable
load ( string $source, mixed $contentType, array | Traversable | Options $options = [] ) : Document | Result | null
loadFragment ( string $source, mixed $contentType, array | Traversable | Options $options = [] ) : DocumentFragment | null
supports ( string $contentType ) : boolean

Private Methods

Method Description
normalizeContentType ( $contentType )

Method Details

__construct() public method

public __construct ( array $loaders = [] )
$loaders array

add() public method

Add a loader to the list
public add ( string $contentType, FluentDOM\Loadable | callable $loader )
$contentType string
$loader FluentDOM\Loadable | callable

addClasses() public method

Add loader classes for different types
public addClasses ( array[] $classes, string $namespace = '' )
$classes array[] ['class' => ['type/one', 'type/two'], ...]
$namespace string

get() public method

public get ( string $contentType ) : boolean | FluentDOM\Loadable
$contentType string
return boolean | FluentDOM\Loadable

load() public method

public load ( string $source, mixed $contentType, array | Traversable | Options $options = [] ) : Document | Result | null
$source string
$contentType mixed
$options array | Traversable | Options
return FluentDOM\Document | Result | null

loadFragment() public method

public loadFragment ( string $source, mixed $contentType, array | Traversable | Options $options = [] ) : DocumentFragment | null
$source string
$contentType mixed
$options array | Traversable | Options
return FluentDOM\DocumentFragment | null

supports() public method

public supports ( string $contentType ) : boolean
$contentType string
return boolean