PHP 클래스 Neos\FluidAdaptor\Core\ViewHelper\ViewHelperResolver

Class whose purpose is dedicated to resolving classes which can be used as ViewHelpers and ExpressionNodes in Fluid. In addition to modifying the behavior or the parser when legacy mode is requested, this ViewHelperResolver is also made capable of "mixing" two different ViewHelper namespaces to effectively create aliases for the Fluid core ViewHelpers to be loaded in the (TYPO3|Neos) scope as well.
상속: extends TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperResolver
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$namespaces array Custom merged namespace for Neos Fluid adapter; will look for classes in both namespaces starting from the bottom.
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$packageManager Neos\Flow\Package\PackageManagerInterface

공개 메소드들

메소드 설명
__construct ( ) ViewHelperResolver constructor.
addNamespace ( string $identifier, string | array $phpNamespace ) : void Add a PHP namespace where ViewHelpers can be found and give it an alias/identifier.
createViewHelperInstanceFromClassName ( string $viewHelperClassName ) : TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface
getDefaultNamespaces ( )
initializeObject ( $reason )

보호된 메소드들

메소드 설명
addNamespaceInternal ( string $identifier, string $phpNamespace )

메소드 상세

__construct() 공개 메소드

ViewHelperResolver constructor.
public __construct ( )

addNamespace() 공개 메소드

The provided namespace can be either a single namespace or an array of namespaces, as strings. The identifier/alias is always a single, alpha-numeric ASCII string. Calling this method multiple times with different PHP namespaces for the same alias causes that namespace to be *extended*, meaning that the PHP namespace you provide second, third etc. are also used in lookups and are used *first*, so that if any of the namespaces you add contains a class placed and named the same way as one that exists in an earlier namespace, then your class gets used instead of the earlier one. Example: $resolver->addNamespace('my', 'My\Package\ViewHelpers'); Any ViewHelpers under this namespace can now be accessed using for example {my:example()} Now, assuming you also have an ExampleViewHelper class in a different namespace and wish to make that ExampleViewHelper override the other: $resolver->addNamespace('my', 'My\OtherPackage\ViewHelpers'); Now, since ExampleViewHelper exists in both places but the My\OtherPackage\ViewHelpers namespace was added *last*, Fluid will find and use My\OtherPackage\ViewHelpers\ExampleViewHelper. Alternatively, setNamespaces() can be used to reset and redefine all previously added namespaces - which is great for cases where you need to remove or replace previously added namespaces. Be aware that setNamespaces() also removes the default "f" namespace, so when you use this method you should always include the "f" namespace.
public addNamespace ( string $identifier, string | array $phpNamespace ) : void
$identifier string
$phpNamespace string | array
리턴 void

addNamespaceInternal() 보호된 메소드

protected addNamespaceInternal ( string $identifier, string $phpNamespace )
$identifier string
$phpNamespace string

createViewHelperInstanceFromClassName() 공개 메소드

public createViewHelperInstanceFromClassName ( string $viewHelperClassName ) : TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface
$viewHelperClassName string
리턴 TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInterface

getDefaultNamespaces() 공개 메소드

initializeObject() 공개 메소드

public initializeObject ( $reason )

프로퍼티 상세

$namespaces 보호되어 있는 프로퍼티

Custom merged namespace for Neos Fluid adapter; will look for classes in both namespaces starting from the bottom.
protected array $namespaces
리턴 array

$objectManager 보호되어 있는 프로퍼티

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
리턴 Neos\Flow\ObjectManagement\ObjectManagerInterface

$packageManager 보호되어 있는 프로퍼티

protected PackageManagerInterface,Neos\Flow\Package $packageManager
리턴 Neos\Flow\Package\PackageManagerInterface