TemplateView

class \TYPO3\CMS\Fluid\View\TemplateView

Extends
AbstractTemplateView

The main template view. Should be used as view if you want Fluid Templating

Table of Contents

Properties

$controllerContext  : ControllerContext

Methods

__construct()  : mixed
canRender()  : bool
Tells if the view implementation can render the view for the given context.
getLayoutRootPaths()  : string[]
Resolves the layout root to be used inside other paths.
getPartialRootPaths()  : string[]
Returns the absolute path to the folder that contains Fluid partial files
getTemplateRootPaths()  : string[]
Resolves the template root to be used inside other paths.
initializeView()  : mixed
Initializes this view.
setControllerContext()  : mixed
Sets the current controller context
setLayoutPathAndFilename()  : mixed
Sets the path and name of the layout file. Overrides the dynamic resolving of the layout file.
setLayoutRootPaths()  : mixed
Set the root path(s) to the layouts.
setPartialRootPaths()  : mixed
Set the root path(s) to the partials.
setTemplate()  : mixed
setTemplatePathAndFilename()  : mixed
Sets the path and name of of the template file. Effectively overrides the dynamic resolving of a template file.
setTemplateRootPaths()  : mixed
Set the root path(s) to the templates.

Properties

Methods

__construct()

public __construct([RenderingContextInterface|null $context = null ]) : mixed

Parameters

$context : RenderingContextInterface|null = null

canRender()

Tells if the view implementation can render the view for the given context.

public canRender(ControllerContext $controllerContext) : bool

Deprecated

since TYPO3 v11, will be removed in v12. Legacy method, not part of ViewInterface anymore.

By default we assume that the view implementation can handle all kinds of contexts. Override this method if that is not the case.

Parameters

$controllerContext : ControllerContext

Controller context which is available inside the view

Return values

bool —

TRUE if the view has something useful to display, otherwise FALSE

getLayoutRootPaths()

Resolves the layout root to be used inside other paths.

public getLayoutRootPaths() : string[]

Tags

throws
InvalidTemplateResourceException

Return values

string[] —

Fluid layout root paths

getPartialRootPaths()

Returns the absolute path to the folder that contains Fluid partial files

public getPartialRootPaths() : string[]

Tags

throws
InvalidTemplateResourceException

Return values

string[] —

Fluid partial root paths

getTemplateRootPaths()

Resolves the template root to be used inside other paths.

public getTemplateRootPaths() : string[]

Return values

string[] —

Path(s) to template root directory

initializeView()

Initializes this view.

public initializeView() : mixed

Deprecated

since v11, will be removed with v12. Drop together with removal of extbase ViewInterface.

setControllerContext()

Sets the current controller context

public setControllerContext(ControllerContext $controllerContext) : mixed

Deprecated

since v11, will be removed with v12.

Parameters

$controllerContext : ControllerContext

setLayoutPathAndFilename()

Sets the path and name of the layout file. Overrides the dynamic resolving of the layout file.

public setLayoutPathAndFilename(string $layoutPathAndFilename) : mixed

Parameters

$layoutPathAndFilename : string

Path and filename of the layout file

setLayoutRootPaths()

Set the root path(s) to the layouts.

public setLayoutRootPaths(string[] $layoutRootPaths) : mixed

If set, overrides the one determined from $this->layoutRootPathPattern

Parameters

$layoutRootPaths : string[]

Root path to the layouts. If set, overrides the one determined from $this->layoutRootPathPattern

setPartialRootPaths()

Set the root path(s) to the partials.

public setPartialRootPaths(string[] $partialRootPaths) : mixed

If set, overrides the one determined from $this->partialRootPathPattern

Parameters

$partialRootPaths : string[]

Root paths to the partials. If set, overrides the one determined from $this->partialRootPathPattern

setTemplate()

public setTemplate(string $templateName) : mixed

Parameters

$templateName : string

setTemplatePathAndFilename()

Sets the path and name of of the template file. Effectively overrides the dynamic resolving of a template file.

public setTemplatePathAndFilename(string $templatePathAndFilename) : mixed

Parameters

$templatePathAndFilename : string

Template file path

setTemplateRootPaths()

Set the root path(s) to the templates.

public setTemplateRootPaths(string[] $templateRootPaths) : mixed

If set, overrides the one determined from $this->templateRootPathPattern

Parameters

$templateRootPaths : string[]

Root path(s) to the templates. If set, overrides the one determined from $this->templateRootPathPattern

On this page