PHP Класс FOF30\Container\Container

The properties below (except componentName, bareComponentName and the ones marked with property-read) can be configured in the fof.xml component configuration file. Sample fof.xml: The paths can use the variables %ROOT%, %PUBLIC%, %ADMIN%, %TMP%, %LOG% i.e. all the path keys returned by Platform's getPlatformBaseDirs() method in uppercase and surrounded by percent signs.
Наследование: extends ContainerBase
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$instances array Cache of created container instances

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

Метод Описание
__construct ( array $values = [] ) Public constructor. This does NOT go through the fof.xml file. You are advised to use getInstance() instead.
getInstance ( string $component, array $values = [], string $section = 'auto' ) : Container Returns a container instance for a specific component. This method goes through fof.xml to read the default configuration values for the container. You are advised to use this unless you have a specific reason for instantiating a Container without going through the fof.xml file.
getNamespacePrefix ( string $section = 'auto' ) : string Get the applicable namespace prefix for a component section. Possible sections: auto Auto-detect which is the current component section inverse The inverse area than auto site Frontend admin Backend
parsePathVariables ( $path )

Защищенные методы

Метод Описание
getDefaultMediaVersion ( ) : string Gets the default media version string for the component using the component's version and date, as well as the site's secret key.
makeInstance ( string $component, array $values = [], string $section = 'auto' ) : Container Returns a temporary container instance for a specific component.

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

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

Public constructor. This does NOT go through the fof.xml file. You are advised to use getInstance() instead.
public __construct ( array $values = [] )
$values array Overrides for the container configuration and services

getDefaultMediaVersion() защищенный Метод

Gets the default media version string for the component using the component's version and date, as well as the site's secret key.
protected getDefaultMediaVersion ( ) : string
Результат string

getInstance() публичный статический Метод

Pass the value 'tempInstance' => true in the $values array to get a temporary instance. Otherwise you will get the cached instance of the previously created container.
public static getInstance ( string $component, array $values = [], string $section = 'auto' ) : Container
$component string The component you want to get a container for, e.g. com_foobar.
$values array Container configuration overrides you want to apply. Optional.
$section string The application section (site, admin) you want to fetch. Any other value results in auto-detection.
Результат Container

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

Get the applicable namespace prefix for a component section. Possible sections: auto Auto-detect which is the current component section inverse The inverse area than auto site Frontend admin Backend
public getNamespacePrefix ( string $section = 'auto' ) : string
$section string The section you want to get information for
Результат string The namespace prefix for the component's classes, e.g. \Foobar\Example\Site\

makeInstance() защищенный статический Метод

Returns a temporary container instance for a specific component.
protected static makeInstance ( string $component, array $values = [], string $section = 'auto' ) : Container
$component string The component you want to get a container for, e.g. com_foobar.
$values array Container configuration overrides you want to apply. Optional.
$section string The application section (site, admin) you want to fetch. Any other value results in auto-detection.
Результат Container

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

public parsePathVariables ( $path )

Описание свойств

$instances защищенное статическое свойство

Cache of created container instances
protected static array $instances
Результат array