YamlFileLoader
class YamlFileLoader extends FileLoader
YamlFileLoader загружает определения сервисов из файлов YAML.
Формат YAML не поддерживает анонимные сервисы (см. загрузчик XML).
Методы
| 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 |
| 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 |
$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 |
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/2.7/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.html