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
파일 보기 프로젝트 열기: akeeba/fof 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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