PHP Класс Neos\FluidAdaptor\View\TemplatePaths

Custom implementation for template paths resolving, one which differs from the base implementation in that it is capable of resolving template paths based on TypoScript configuration when given a package name, and is aware of the Frontend/Backend contexts of TYPO3.
Наследование: extends TYPO3Fluid\Fluid\View\TemplatePaths
Показать файл Открыть проект

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

Свойство Тип Описание
$layoutRootPathPattern string
$options array
$packageManager Neos\Flow\Package\PackageManagerInterface
$partialRootPathPattern string
$patternReplacementVariables string[] A map of key => values to be replaced in path patterns.
$templateRootPathPattern string

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

Метод Описание
__construct ( array $options = [] )
getLayoutPathAndFilename ( string $layoutName = 'Default' ) : string Resolve the path and file name of the layout file, based on $this->options['layoutPathAndFilename'] and $this->options['layoutPathAndFilenamePattern'].
getLayoutRootPaths ( ) : array
getOption ( string $optionName ) : mixed Get a specific option of this object
getPartialPathAndFilename ( string $partialName ) : string Resolve the partial path and filename based on $this->options['partialPathAndFilenamePattern'].
getPartialRootPaths ( )
getPatternReplacementVariables ( ) : string[]
getTemplateRootPathPattern ( ) : string
getTemplateRootPaths ( ) : array Resolves the template root to be used inside other paths.
injectPackageManager ( Neos\Flow\Package\PackageManagerInterface $packageManager )
resolveTemplateFileForControllerAndActionAndFormat ( string $controller, string $action, string $format = null ) : mixed | string Resolves a template file based on the given controller and action, together with eventually defined patternReplacementVariables.
setLayoutRootPath ( string $layoutRootPath )
setLayoutRootPathPattern ( string $layoutRootPathPattern )
setOption ( string $optionName, mixed $value ) : void Set a specific option of this object
setPartialRootPath ( string $partialRootPath )
setPartialRootPathPattern ( string $partialRootPathPattern )
setPatternReplacementVariables ( string[] $patternReplacementVariables )
setTemplateRootPath ( string $templateRootPath )
setTemplateRootPathPattern ( string $templateRootPathPattern )

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

Метод Описание
createIdentifierForFile ( string $pathAndFilename, string $prefix ) : string Returns a unique identifier for the given file in the format ____ The SH1 hash is a checksum that is based on the file path and last modification date
expandGenericPathPattern ( string $pattern, array $patternReplacementVariables, boolean $bubbleControllerAndSubpackage, boolean $formatIsOptional ) : array Processes following placeholders inside $pattern: - "@templateRoot" - "@partialRoot" - "@layoutRoot" - "@subpackage" - "@controller" - "@format"
expandPatterns ( array $patterns, string $search, array $replacements ) : void Expands the given $patterns by adding an array element for each $replacement replacing occurrences of $search.
expandSubPackageAndController ( array $paths, string $controllerName, null $subPackageKey = null, boolean $bubbleControllerAndSubpackage = false ) : array
getPackagePath ( string $packageName ) : string
getPackagePrivateResourcesPath ( string $packageKey ) : string | null
replacePatternVariable ( array $paths, string $variableName, string $variableValue ) : array
sanitizePath ( string $path ) : string Sanitize a path, ensuring it is absolute and if a directory, suffixed by a trailing slash.

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

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

public __construct ( array $options = [] )
$options array

createIdentifierForFile() защищенный метод

Returns a unique identifier for the given file in the format ____ The SH1 hash is a checksum that is based on the file path and last modification date
protected createIdentifierForFile ( string $pathAndFilename, string $prefix ) : string
$pathAndFilename string
$prefix string
Результат string

expandGenericPathPattern() защищенный метод

This method is used to generate "fallback chains" for file system locations where a certain Partial can reside. If $bubbleControllerAndSubpackage is FALSE and $formatIsOptional is FALSE, then the resulting array will only have one element with all the above placeholders replaced. If you set $bubbleControllerAndSubpackage to TRUE, then you will get an array with potentially many elements: The first element of the array is like above. The second element has the @ controller part set to "" (the empty string) The third element now has the @ controller part again stripped off, and has the last subpackage part stripped off as well. This continues until both "@subpackage" and "@controller" are empty. Example for $bubbleControllerAndSubpackage is TRUE, we have the MyCompany\MyPackage\MySubPackage\Controller\MyController as Controller Object Name and the current format is "html" If pattern is "@templateRoot/@subpackage/@controller/@action.@format", then the resulting array is: - "Resources/Private/Templates/MySubPackage/My/@action.html" - "Resources/Private/Templates/MySubPackage/@action.html" - "Resources/Private/Templates/@action.html" If you set $formatIsOptional to TRUE, then for any of the above arrays, every element will be duplicated - once with "@format" replaced by the current request format, and once with ."@format" stripped off.
protected expandGenericPathPattern ( string $pattern, array $patternReplacementVariables, boolean $bubbleControllerAndSubpackage, boolean $formatIsOptional ) : array
$pattern string Pattern to be resolved
$patternReplacementVariables array The variables to replace in the pattern
$bubbleControllerAndSubpackage boolean if TRUE, then we successively split off parts from "@controller" and "@subpackage" until both are empty.
$formatIsOptional boolean if TRUE, then half of the resulting strings will have ."@format" stripped off, and the other half will have it.
Результат array unix style paths

expandPatterns() защищенный метод

Expands the given $patterns by adding an array element for each $replacement replacing occurrences of $search.
protected expandPatterns ( array $patterns, string $search, array $replacements ) : void
$patterns array
$search string
$replacements array
Результат void

expandSubPackageAndController() защищенный метод

protected expandSubPackageAndController ( array $paths, string $controllerName, null $subPackageKey = null, boolean $bubbleControllerAndSubpackage = false ) : array
$paths array
$controllerName string
$subPackageKey null
$bubbleControllerAndSubpackage boolean
Результат array

getLayoutPathAndFilename() публичный метод

In case a layout has already been set with setLayoutPathAndFilename(), this method returns that path, otherwise a path and filename will be resolved using the layoutPathAndFilenamePattern.
public getLayoutPathAndFilename ( string $layoutName = 'Default' ) : string
$layoutName string Name of the layout to use. If none given, use "Default"
Результат string Path and filename of layout files

getLayoutRootPaths() публичный метод

public getLayoutRootPaths ( ) : array
Результат array

getOption() публичный метод

Get a specific option of this object
public getOption ( string $optionName ) : mixed
$optionName string
Результат mixed

getPackagePath() защищенный метод

protected getPackagePath ( string $packageName ) : string
$packageName string
Результат string

getPackagePrivateResourcesPath() защищенный метод

protected getPackagePrivateResourcesPath ( string $packageKey ) : string | null
$packageKey string
Результат string | null

getPartialPathAndFilename() публичный метод

Resolve the partial path and filename based on $this->options['partialPathAndFilenamePattern'].
public getPartialPathAndFilename ( string $partialName ) : string
$partialName string The name of the partial
Результат string the full path which should be used. The path definitely exists.

getPartialRootPaths() публичный метод

public getPartialRootPaths ( )

getPatternReplacementVariables() публичный метод

public getPatternReplacementVariables ( ) : string[]
Результат string[]

getTemplateRootPathPattern() публичный метод

public getTemplateRootPathPattern ( ) : string
Результат string

getTemplateRootPaths() публичный метод

Resolves the template root to be used inside other paths.
public getTemplateRootPaths ( ) : array
Результат array Path(s) to template root directory

injectPackageManager() публичный метод

public injectPackageManager ( Neos\Flow\Package\PackageManagerInterface $packageManager )
$packageManager Neos\Flow\Package\PackageManagerInterface

replacePatternVariable() защищенный метод

protected replacePatternVariable ( array $paths, string $variableName, string $variableValue ) : array
$paths array
$variableName string
$variableValue string
Результат array

resolveTemplateFileForControllerAndActionAndFormat() публичный метод

Resolves a template file based on the given controller and action, together with eventually defined patternReplacementVariables.
public resolveTemplateFileForControllerAndActionAndFormat ( string $controller, string $action, string $format = null ) : mixed | string
$controller string
$action string
$format string
Результат mixed | string

sanitizePath() защищенный метод

Sanitize a path, ensuring it is absolute and if a directory, suffixed by a trailing slash.
protected sanitizePath ( string $path ) : string
$path string
Результат string

setLayoutRootPath() публичный метод

public setLayoutRootPath ( string $layoutRootPath )
$layoutRootPath string

setLayoutRootPathPattern() публичный метод

public setLayoutRootPathPattern ( string $layoutRootPathPattern )
$layoutRootPathPattern string

setOption() публичный метод

Set a specific option of this object
public setOption ( string $optionName, mixed $value ) : void
$optionName string
$value mixed
Результат void

setPartialRootPath() публичный метод

public setPartialRootPath ( string $partialRootPath )
$partialRootPath string

setPartialRootPathPattern() публичный метод

public setPartialRootPathPattern ( string $partialRootPathPattern )
$partialRootPathPattern string

setPatternReplacementVariables() публичный метод

public setPatternReplacementVariables ( string[] $patternReplacementVariables )
$patternReplacementVariables string[]

setTemplateRootPath() публичный метод

public setTemplateRootPath ( string $templateRootPath )
$templateRootPath string

setTemplateRootPathPattern() публичный метод

public setTemplateRootPathPattern ( string $templateRootPathPattern )
$templateRootPathPattern string

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

$layoutRootPathPattern защищенное свойство

protected string $layoutRootPathPattern
Результат string

$options защищенное свойство

protected array $options
Результат array

$packageManager защищенное свойство

protected PackageManagerInterface,Neos\Flow\Package $packageManager
Результат Neos\Flow\Package\PackageManagerInterface

$partialRootPathPattern защищенное свойство

protected string $partialRootPathPattern
Результат string

$patternReplacementVariables защищенное свойство

A map of key => values to be replaced in path patterns.
protected string[] $patternReplacementVariables
Результат string[]

$templateRootPathPattern защищенное свойство

protected string $templateRootPathPattern
Результат string