PHP Class Neos\Neos\Domain\Service\TypoScriptService

Show file Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$appendTypoScriptIncludes array Example: array( 'resources://MyVendor.MyPackageKey/Private/TypoScript/Root.fusion', 'resources://SomeVendor.OtherPackage/Private/TypoScript/Root.fusion' )
$autoIncludeConfiguration array
$autoIncludeTypoScriptPattern string Pattern used for determining the TypoScript root file for autoIncludes
$legacyAutoIncludeTypoScriptPattern string Legacy pattern used for determining the TypoScript root file for autoIncludes
$legacySiteRootTypoScriptPattern string Legacy pattern used for determining the TypoScript root file for a site
$nodeTypeManager Neos\ContentRepository\Domain\Service\NodeTypeManager
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$packageManager Neos\Flow\Package\PackageManagerInterface
$prependTypoScriptIncludes array Example: array( 'resources://MyVendor.MyPackageKey/Private/TypoScript/Root.fusion', 'resources://SomeVendor.OtherPackage/Private/TypoScript/Root.fusion' )
$siteRootTypoScriptPattern string Pattern used for determining the TypoScript root file for a site
$typoScriptParser Neos\Fusion\Core\Parser

Public Methods

Method Description
createRuntime ( Neos\ContentRepository\Domain\Model\NodeInterface $currentSiteNode, ControllerContext $controllerContext ) : Runtime Create a runtime for the given site node
getAppendTypoScriptIncludes ( ) : array Get TypoScript resources that will be appended after the site TypoScript.
getMergedTypoScriptObjectTree ( Neos\ContentRepository\Domain\Model\NodeInterface $startNode ) : array Returns a merged TypoScript object tree in the context of the given nodes
getPrependTypoScriptIncludes ( ) : array Get the TypoScript resources that are included before the site TypoScript.
initializeObject ( ) : void Initializes the parser
setAppendTypoScriptIncludes ( array $appendTypoScriptIncludes ) : void Set TypoScript resources that should be appended after the site TypoScript, this defaults to an empty array.
setPrependTypoScriptIncludes ( array $prependTypoScriptIncludes ) : void Set TypoScript resources that should be prepended before the site TypoScript, it defaults to the Neos Root.fusion TypoScript.
setSiteRootTypoScriptPattern ( string $siteRootTypoScriptPattern ) : void Set the pattern for including the site root TypoScript

Protected Methods

Method Description
generateNodeTypeDefinitions ( ) : string Generate TypoScript prototype definitions for all node types
generateTypoScriptForNodeType ( NodeType $nodeType ) : string Generate a TypoScript prototype definition for a given node type
getTypoScriptIncludes ( array $typoScriptResources ) : string Concatenate the given TypoScript resources with include statements
prepareAutoIncludeTypoScript ( ) : array Prepares an array with TypoScript paths to auto include before the Site TypoScript.
readExternalTypoScriptFile ( string $pathAndFilename ) : string Reads the TypoScript file from the given path and filename.

Method Details

createRuntime() public method

Create a runtime for the given site node
public createRuntime ( Neos\ContentRepository\Domain\Model\NodeInterface $currentSiteNode, ControllerContext $controllerContext ) : Runtime
$currentSiteNode Neos\ContentRepository\Domain\Model\NodeInterface
$controllerContext Neos\Flow\Mvc\Controller\ControllerContext
return Neos\Fusion\Core\Runtime

generateNodeTypeDefinitions() protected method

Only fully qualified node types (e.g. MyVendor.MyPackage:NodeType) will be considered.
protected generateNodeTypeDefinitions ( ) : string
return string

generateTypoScriptForNodeType() protected method

A prototype will be rendererd with the generator-class defined in the nodeType-configuration 'fusion.prototypeGenerator'
protected generateTypoScriptForNodeType ( NodeType $nodeType ) : string
$nodeType Neos\ContentRepository\Domain\Model\NodeType
return string

getAppendTypoScriptIncludes() public method

Get TypoScript resources that will be appended after the site TypoScript.

getMergedTypoScriptObjectTree() public method

Returns a merged TypoScript object tree in the context of the given nodes
public getMergedTypoScriptObjectTree ( Neos\ContentRepository\Domain\Model\NodeInterface $startNode ) : array
$startNode Neos\ContentRepository\Domain\Model\NodeInterface Node marking the starting point
return array The merged object tree as of the given node

getPrependTypoScriptIncludes() public method

Get the TypoScript resources that are included before the site TypoScript.

getTypoScriptIncludes() protected method

Concatenate the given TypoScript resources with include statements
protected getTypoScriptIncludes ( array $typoScriptResources ) : string
$typoScriptResources array An array of TypoScript resource URIs
return string A string of include statements for all resources

initializeObject() public method

Initializes the parser
public initializeObject ( ) : void
return void

prepareAutoIncludeTypoScript() protected method

Prepares an array with TypoScript paths to auto include before the Site TypoScript.
protected prepareAutoIncludeTypoScript ( ) : array
return array

readExternalTypoScriptFile() protected method

If it doesn't exist, this function will just return an empty string.
protected readExternalTypoScriptFile ( string $pathAndFilename ) : string
$pathAndFilename string Path and filename of the TypoScript file
return string The content of the .fusion file, plus one chr(10) at the end

setAppendTypoScriptIncludes() public method

Set TypoScript resources that should be appended after the site TypoScript, this defaults to an empty array.
public setAppendTypoScriptIncludes ( array $appendTypoScriptIncludes ) : void
$appendTypoScriptIncludes array An array of TypoScript resource URIs
return void

setPrependTypoScriptIncludes() public method

Set TypoScript resources that should be prepended before the site TypoScript, it defaults to the Neos Root.fusion TypoScript.
public setPrependTypoScriptIncludes ( array $prependTypoScriptIncludes ) : void
$prependTypoScriptIncludes array
return void

setSiteRootTypoScriptPattern() public method

Set the pattern for including the site root TypoScript
public setSiteRootTypoScriptPattern ( string $siteRootTypoScriptPattern ) : void
$siteRootTypoScriptPattern string A string for the sprintf format that takes the site package key as a single placeholder
return void

Property Details

$appendTypoScriptIncludes protected property

Example: array( 'resources://MyVendor.MyPackageKey/Private/TypoScript/Root.fusion', 'resources://SomeVendor.OtherPackage/Private/TypoScript/Root.fusion' )
protected array $appendTypoScriptIncludes
return array

$autoIncludeConfiguration protected property

protected array $autoIncludeConfiguration
return array

$autoIncludeTypoScriptPattern protected property

Pattern used for determining the TypoScript root file for autoIncludes
protected string $autoIncludeTypoScriptPattern
return string

$legacyAutoIncludeTypoScriptPattern protected property

Legacy pattern used for determining the TypoScript root file for autoIncludes
Deprecation: since 3.0 will be removed in 4.0
protected string $legacyAutoIncludeTypoScriptPattern
return string

$legacySiteRootTypoScriptPattern protected property

Legacy pattern used for determining the TypoScript root file for a site
Deprecation: since 3.0 will be removed in 4.0
protected string $legacySiteRootTypoScriptPattern
return string

$nodeTypeManager protected property

protected NodeTypeManager,Neos\ContentRepository\Domain\Service $nodeTypeManager
return Neos\ContentRepository\Domain\Service\NodeTypeManager

$objectManager protected property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
return Neos\Flow\ObjectManagement\ObjectManagerInterface

$packageManager protected property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
return Neos\Flow\Package\PackageManagerInterface

$prependTypoScriptIncludes protected property

Example: array( 'resources://MyVendor.MyPackageKey/Private/TypoScript/Root.fusion', 'resources://SomeVendor.OtherPackage/Private/TypoScript/Root.fusion' )
protected array $prependTypoScriptIncludes
return array

$siteRootTypoScriptPattern protected property

Pattern used for determining the TypoScript root file for a site
protected string $siteRootTypoScriptPattern
return string

$typoScriptParser protected property

protected Parser,Neos\Fusion\Core $typoScriptParser
return Neos\Fusion\Core\Parser