Resolves view scripts based on a stack of paths

package Default

 Methods

Constructor

__construct(null|array|\Traversable $options = null

Parameters

$options

nullarray\Traversable

Add a single path to the stack

addPath(string $path) : \Zend\View\Resolver\TemplatePathStack

Parameters

$path

string

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

\Zend\View\Resolver\TemplatePathStack

Add many paths to the stack at once

addPaths(array $paths) : \Zend\View\Resolver\TemplatePathStack

Parameters

$paths

array

Returns

\Zend\View\Resolver\TemplatePathStack

Clear all paths

clearPaths() : void

Get default file suffix

getDefaultSuffix() : string

Returns

string

Get the last lookup failure message, if any

getLastLookupFailure() : false | string

Returns

falsestring

Returns stack of paths

getPaths() : \Zend\Stdlib\SplStack

Returns

\Zend\Stdlib\SplStack

Return status of LFI protection flag

isLfiProtectionOn() : boolean

Returns

boolean

Normalize a path for insertion in the stack

normalizePath(string $path) : string
Static

Parameters

$path

string

Returns

string

Retrieve the filesystem path to a view script

resolve(string $name, null|\Zend\View\Renderer\RendererInterface $renderer = null) : string
inherited_from \Zend\View\Resolver\ResolverInterface::resolve()

Parameters

$name

string

$renderer

null\Zend\View\Renderer\RendererInterface

Exceptions

\Zend\View\Exception\DomainException

Returns

string

Set default file suffix

setDefaultSuffix(string $defaultSuffix) : \Zend\View\Resolver\TemplatePathStack

Parameters

$defaultSuffix

string

Returns

\Zend\View\Resolver\TemplatePathStack

Set LFI protection flag

setLfiProtection(boolean $flag) : \Zend\View\Resolver\TemplatePathStack

Parameters

$flag

boolean

Returns

\Zend\View\Resolver\TemplatePathStack

Configure object

setOptions(array|\Traversable $options) : void

Parameters

$options

array\Traversable

Exceptions

\Zend\View\Exception\InvalidArgumentException

Rest the path stack to the paths provided

setPaths(\Zend\Stdlib\SplStack|array $paths) : \Zend\View\Resolver\TemplatePathStack

Parameters

$paths

\Zend\Stdlib\SplStackarray

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

\Zend\View\Resolver\TemplatePathStack

Set flag indicating if stream wrapper should be used if short_open_tag is off

setUseStreamWrapper(boolean $flag) : \Zend\View\Resolver\TemplatePathStack

Parameters

$flag

boolean

Returns

\Zend\View\Resolver\TemplatePathStack

Should the stream wrapper be used if short_open_tag is off?

useStreamWrapper() : boolean

Returns true if the use_stream_wrapper flag is set, and if short_open_tag is disabled.

Returns

boolean

 Properties

 

Default suffix to use

$defaultSuffix : string

Default

'phtml'

Appends this suffix if the template requested does not use it.

 

Reason for last lookup failure

$lastLookupFailure : false | string

Default

false
 

Flag indicating whether or not LFI protection for rendering view scripts is enabled

$lfiProtectionOn : boolean

Default

true
 

$paths

$paths : \Zend\Stdlib\SplStack

Default

 

$useStreamWrapper

$useStreamWrapper 

Default

false
 

$useViewStream

$useViewStream 

Default

false

 Constants

 

FAILURE_NOT_FOUND

FAILURE_NOT_FOUND = 'TemplatePathStack_Failure_Not_Found' 
 

FAILURE_NO_PATHS

FAILURE_NO_PATHS = 'TemplatePathStack_Failure_No_Paths'