FluentDOM\Loaders::load PHP Method

load() public method

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
return DOMDocument | FluentDOM\Loader\Result | null
    public function load($source, $contentType, $options = [])
    {
        $dom = NULL;
        foreach ($this as $loader) {
            /**
             * @var Loadable $loader
             */
            if ($loader->supports($contentType) && ($dom = $loader->load($source, $contentType, $options))) {
                break;
            }
        }
        return $dom instanceof \DOMDocument || $dom instanceof Result ? $dom : NULL;
    }