Spec-Zone.ru › Symfony 3.4

YamlFileLoader

class YamlFileLoader extends FileLoader

YamlFileLoader загружает определения сервисов из YAML-файлов.

Методы

LoaderResolverInterface getResolver()

Получает решатель загрузчиков.

from Loader
setResolver(LoaderResolverInterface $resolver)

Устанавливает решатель загрузчиков.

from Loader
mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null)

Импортирует ресурс.

from FileLoader
$this|LoaderInterface resolve(mixed $resource, string|null $type = null)

Находит загрузчик, способный загрузить импортированный ресурс.

from Loader
__construct(ContainerBuilder $container, FileLocatorInterface $locator) from FileLoader
setCurrentDir(string $dir)

Устанавливает текущую директорию.

from FileLoader
FileLocatorInterface getLocator()

Возвращает локатор файлов, используемый этим загрузчиком.

from FileLoader
registerClasses(Definition $prototype, string $namespace, string $resource, string $exclude = null)

Регистрирует набор классов в качестве сервисов с использованием PSR-4 для обнаружения.

from FileLoader
load(mixed $resource, string|null $type = null)

Загружает ресурс.

bool supports(mixed $resource, string|null $type = null)

Возвращает, поддерживает ли этот класс данный ресурс.

Подробности

LoaderResolverInterface getResolver()

Получает решатель загрузчиков.

Возвращаемое значение

LoaderResolverInterface Объект типа LoaderResolverInterface

setResolver(LoaderResolverInterface $resolver)

Устанавливает решатель загрузчиков.

Параметры

LoaderResolverInterface $resolver

mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null)

Импортирует ресурс.

Параметры

mixed $resource Ресурс
string|null $type Тип ресурса или null, если неизвестен
bool $ignoreErrors Игнорировать ошибки импорта или нет
string|null $sourceResource Исходный ресурс, импортирующий новый ресурс

Возвращаемое значение

mixed

Исключения

FileLoaderLoadException
FileLoaderImportCircularReferenceException
FileLocatorFileNotFoundException

$this|LoaderInterface resolve(mixed $resource, string|null $type = null)

Находит загрузчик, способный загрузить импортированный ресурс.

Параметры

mixed $resource Ресурс
string|null $type Тип ресурса или null, если неизвестен

Возвращаемое значение

$this|LoaderInterface

Исключения

FileLoaderLoadException Если загрузчик не найден

__construct(ContainerBuilder $container, FileLocatorInterface $locator)

Параметры

ContainerBuilder $container
FileLocatorInterface $locator

setCurrentDir(string $dir)

Устанавливает текущую директорию.

Параметры

string $dir

FileLocatorInterface getLocator()

Возвращает локатор файлов, используемый этим загрузчиком.

Возвращаемое значение

FileLocatorInterface

registerClasses(Definition $prototype, string $namespace, string $resource, string $exclude = null)

Регистрирует набор классов в качестве сервисов с использованием PSR-4 для обнаружения.

Параметры

Definition $prototype Определение, используемое в качестве шаблона
string $namespace Префикс пространства имен классов в отсканированной директории
string $resource Директория для поиска классов, допускаются шаблоны glob
string $exclude Путь к файлам для исключения (шаблон glob)

load(mixed $resource, string|null $type = null)

Загружает ресурс.

Параметры

mixed $resource Ресурс
string|null $type Тип ресурса или null, если неизвестен

Исключения

Exception Если возникла ошибка

bool supports(mixed $resource, string|null $type = null)

Возвращает, поддерживает ли этот класс данный ресурс.

Параметры

mixed $resource Ресурс
string|null $type Тип ресурса или null, если неизвестен

Возвращаемое значение

bool True, если класс поддерживает данный ресурс, иначе false

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.3/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API