abstract class AbstractTemplateView extends AbstractTemplateView implements ViewInterface (View source)

The abstract base of all Fluid views.

Properties

protected array $supportedOptions

This contains the supported options, their default values, descriptions and types.

protected array $options

The configuration options of this view

protected ControllerContext $controllerContext

Methods

static ViewInterface
createWithOptions(array $options)

Factory method to create an instance with given options.

__construct(array $options = null)

Set default options based on the supportedOptions provided

void
setTemplatePathAndFilename(string $templatePathAndFilename)

No description

void
setControllerContext(ControllerContext $controllerContext)

No description

bool
canRender(ControllerContext $controllerContext)

No description

string
renderSection(string $sectionName, array $variables = [], bool $ignoreUnknown = false)

Renders a given section.

void
validateOptions(array $options)

Validate options given to this view.

void
setOptions(array $options)

Merges the given options with the default values and sets the resulting options in this object.

mixed
getOption(string $optionName)

Get a specific option of this View

void
setOption(string $optionName, mixed $value)

Set a specific option of this View

Details

static ViewInterface createWithOptions(array $options)

Factory method to create an instance with given options.

Parameters

array $options

Return Value

ViewInterface

__construct(array $options = null)

Set default options based on the supportedOptions provided

Parameters

array $options

Exceptions

Exception

void setTemplatePathAndFilename(string $templatePathAndFilename)

No description

Parameters

string $templatePathAndFilename

Return Value

void

void setControllerContext(ControllerContext $controllerContext)

No description

Parameters

ControllerContext $controllerContext

Context of the controller associated with this view

Return Value

void

bool canRender(ControllerContext $controllerContext)

No description

Parameters

ControllerContext $controllerContext

Return Value

bool

true if the view has something useful to display, otherwise false

string renderSection(string $sectionName, array $variables = [], bool $ignoreUnknown = false)

Renders a given section.

Parameters

string $sectionName

Name of section to render

array $variables

The variables to use

bool $ignoreUnknown

Ignore an unknown section and just return an empty string

Return Value

string

rendered template for the section

Exceptions

InvalidSectionException

protected void validateOptions(array $options)

Validate options given to this view.

Parameters

array $options

Return Value

void

Exceptions

Exception

protected void setOptions(array $options)

Merges the given options with the default values and sets the resulting options in this object.

Parameters

array $options

Return Value

void

mixed getOption(string $optionName)

Get a specific option of this View

Parameters

string $optionName

Return Value

mixed

Exceptions

Exception

void setOption(string $optionName, mixed $value)

Set a specific option of this View

Parameters

string $optionName
mixed $value

Return Value

void

Exceptions

Exception