TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Fluid\View\StandaloneView Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\View\StandaloneView:
TYPO3\CMS\Fluid\View\AbstractTemplateView TYPO3\CMS\Extbase\Mvc\View\ViewInterface TYPO3\CMS\Install\View\StandaloneView

Public Member Functions

 setFormat ($format)
 
 getFormat ()
 
 getRequest ()
 
 setTemplatePathAndFilename ($templatePathAndFilename)
 
 getTemplatePathAndFilename ()
 
 setTemplateSource ($templateSource)
 
 setTemplateRootPaths (array $templateRootPaths)
 
 setTemplate ($templateName)
 
 setLayoutRootPath ($layoutRootPath)
 
 setLayoutRootPaths (array $layoutRootPaths)
 
 getLayoutRootPath ()
 
 getLayoutRootPaths ()
 
 setPartialRootPath ($partialRootPath)
 
 getPartialRootPath ()
 
 setPartialRootPaths (array $partialRootPaths)
 
 getPartialRootPaths ()
 
 hasTemplate ()
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\View\AbstractTemplateView
 injectTemplateCompiler (\TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 setControllerContext (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 initializeView ()
 
 assign ($key, $value)
 
 assignMultiple (array $values)
 
 render ($actionName=null)
 
 renderSection ($sectionName, array $variables, $ignoreUnknown=false)
 
 renderPartial ($partialName, $sectionName, array $variables)
 
 canRender (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
- Public Member Functions inherited from TYPO3\CMS\Extbase\Mvc\View\ViewInterface
 setControllerContext (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 canRender (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 render ()
 

Protected Member Functions

 getTemplateIdentifier ($actionName=null)
 
 getTemplateSource ($actionName=null)
 
 getLayoutIdentifier ($layoutName='Default')
 
 getLayoutSource ($layoutName='Default')
 
 getLayoutPathAndFilename ($layoutName='Default')
 
 getPartialIdentifier ($partialName)
 
 getPartialSource ($partialName)
 
 getPartialPathAndFilename ($partialName)
 
 buildListOfTemplateCandidates ($templateName, array $paths, $format)
 
 createIdentifierForFile ($pathAndFilename, $prefix)
 
 resolveFileNamePath ($pathAndFilename)
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\View\AbstractTemplateView
 ucFileNameInPath ($templatePath)
 
 testFileExistence ($filePath)
 
 getTemplateIdentifier ($actionName=null)
 
 getTemplateSource ($actionName=null)
 
 getLayoutIdentifier ($layoutName='Default')
 
 getLayoutSource ($layoutName='Default')
 
 getPartialIdentifier ($partialName)
 
 getPartialSource ($partialName)
 
 buildParserConfiguration ()
 
 startRendering ($type, \TYPO3\CMS\Fluid\Core\Parser\ParsedTemplateInterface $parsedTemplate, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 stopRendering ()
 
 getCurrentRenderingType ()
 
 getCurrentParsedTemplate ()
 
 getCurrentRenderingContext ()
 

Protected Attributes

 $templateSource = null
 
 $templatePathAndFilename = null
 
 $templateRootPaths = null
 
 $partialRootPaths = null
 
 $layoutRootPaths = null
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\View\AbstractTemplateView
 $controllerContext
 
 $objectManager
 
 $templateParser
 
 $templateCompiler
 
 $baseRenderingContext
 
 $renderingStack = []
 
 $partialIdentifierCache = []
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Fluid\View\AbstractTemplateView
const RENDERING_TEMPLATE = 1
 
const RENDERING_PARTIAL = 2
 
const RENDERING_LAYOUT = 3
 

Detailed Description

A standalone template view. Should be used as view if you want to use Fluid without Extbase extensions

Definition at line 43 of file StandaloneView.php.

Member Function Documentation

◆ buildListOfTemplateCandidates()

TYPO3\CMS\Fluid\View\StandaloneView::buildListOfTemplateCandidates (   $templateName,
array  $paths,
  $format 
)
protected

Builds a list of possible candidates for a given template name

Parameters
string$templateNameName of the template to search for
array$pathsPaths to search in
string$formatThe file format to use. e.g 'html' or 'txt'
Returns
array Array of paths to search for the template file

Definition at line 525 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\resolveFileNamePath(), TYPO3\CMS\Extbase\Utility\ArrayUtility\sortArrayWithIntegerKeys(), and TYPO3\CMS\Fluid\View\AbstractTemplateView\ucFileNameInPath().

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getLayoutPathAndFilename(), TYPO3\CMS\Fluid\View\StandaloneView\getPartialPathAndFilename(), and TYPO3\CMS\Fluid\View\StandaloneView\setTemplate().

◆ createIdentifierForFile()

TYPO3\CMS\Fluid\View\StandaloneView::createIdentifierForFile (   $pathAndFilename,
  $prefix 
)
protected

Returns a unique identifier for the given file in the format Standalone_<prefix>_<SHA1> The SH1 hash is a checksum that is based on the file path and last modification date

Parameters
string$pathAndFilename
string$prefix
Returns
string

Definition at line 551 of file StandaloneView.php.

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getLayoutIdentifier(), TYPO3\CMS\Fluid\View\StandaloneView\getPartialIdentifier(), and TYPO3\CMS\Fluid\View\StandaloneView\getTemplateIdentifier().

◆ getFormat()

TYPO3\CMS\Fluid\View\StandaloneView::getFormat ( )

Returns the format of the current request (defaults is "html")

Returns
string $format

Definition at line 134 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\getRequest().

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getLayoutPathAndFilename(), and TYPO3\CMS\Fluid\View\StandaloneView\getPartialPathAndFilename().

◆ getLayoutIdentifier()

TYPO3\CMS\Fluid\View\StandaloneView::getLayoutIdentifier (   $layoutName = 'Default')
protected

Returns a unique identifier for the resolved layout file. This identifier is based on the template path and last modification date

Parameters
string$layoutNameThe name of the layout
Returns
string layout identifier
Exceptions
InvalidTemplateResourceException

Definition at line 417 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\createIdentifierForFile(), and TYPO3\CMS\Fluid\View\StandaloneView\getLayoutPathAndFilename().

◆ getLayoutPathAndFilename()

TYPO3\CMS\Fluid\View\StandaloneView::getLayoutPathAndFilename (   $layoutName = 'Default')
protected

Resolve the path and file name of the layout file, based on $this->getLayoutRootPaths() and request format

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.

Parameters
string$layoutNameName of the layout to use. If none given, use "Default"
Returns
string Path and filename of layout files
Exceptions
InvalidTemplateResourceException

Definition at line 454 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\buildListOfTemplateCandidates(), TYPO3\CMS\Fluid\View\StandaloneView\getFormat(), TYPO3\CMS\Fluid\View\StandaloneView\getLayoutRootPaths(), TYPO3\CMS\Fluid\View\StandaloneView\getRequest(), and TYPO3\CMS\Fluid\View\AbstractTemplateView\testFileExistence().

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getLayoutIdentifier(), and TYPO3\CMS\Fluid\View\StandaloneView\getLayoutSource().

◆ getLayoutRootPath()

TYPO3\CMS\Fluid\View\StandaloneView::getLayoutRootPath ( )

Returns the first found entry in $this->layoutRootPaths. Don't use, this might not be the desired result.

Exceptions
InvalidTemplateResourceException
Returns
string Path to layout root directory
Deprecated:
since Fluid 7; Use getLayoutRootPaths() instead

Definition at line 261 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$layoutRootPaths, TYPO3\CMS\Fluid\View\StandaloneView\getLayoutRootPaths(), and TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

◆ getLayoutRootPaths()

TYPO3\CMS\Fluid\View\StandaloneView::getLayoutRootPaths ( )

Resolves the layout root to be used inside other paths.

Returns
string Fluid layout root path
Exceptions
InvalidTemplateResourceException

Definition at line 275 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$layoutRootPaths.

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getLayoutPathAndFilename(), and TYPO3\CMS\Fluid\View\StandaloneView\getLayoutRootPath().

◆ getLayoutSource()

TYPO3\CMS\Fluid\View\StandaloneView::getLayoutSource (   $layoutName = 'Default')
protected

Resolves the path and file name of the layout file, based on $this->getLayoutRootPaths() and request format and returns the file contents

Parameters
string$layoutNameName of the layout to use. If none given, use "Default"
Returns
string contents of the layout file if it was found
Exceptions
InvalidTemplateResourceException

Definition at line 432 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\getLayoutPathAndFilename().

◆ getPartialIdentifier()

TYPO3\CMS\Fluid\View\StandaloneView::getPartialIdentifier (   $partialName)
protected

Returns a unique identifier for the resolved partial file. This identifier is based on the template path and last modification date

Parameters
string$partialNameThe name of the partial
Returns
string partial identifier
Exceptions
InvalidTemplateResourceException

Definition at line 474 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\createIdentifierForFile(), and TYPO3\CMS\Fluid\View\StandaloneView\getPartialPathAndFilename().

◆ getPartialPathAndFilename()

TYPO3\CMS\Fluid\View\StandaloneView::getPartialPathAndFilename (   $partialName)
protected

Resolve the partial path and filename based on $this->getPartialRootPaths() and request format

Parameters
string$partialNameThe name of the partial
Returns
string The full path which should be used. The path definitely exists.
Exceptions
InvalidTemplateResourceException

Definition at line 506 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\buildListOfTemplateCandidates(), TYPO3\CMS\Fluid\View\StandaloneView\getFormat(), TYPO3\CMS\Fluid\View\StandaloneView\getPartialRootPaths(), TYPO3\CMS\Fluid\View\StandaloneView\getRequest(), and TYPO3\CMS\Fluid\View\AbstractTemplateView\testFileExistence().

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getPartialIdentifier(), and TYPO3\CMS\Fluid\View\StandaloneView\getPartialSource().

◆ getPartialRootPath()

TYPO3\CMS\Fluid\View\StandaloneView::getPartialRootPath ( )

Returns the first found entry in $this->partialRootPaths Don't use, this might not be the desired result.

Exceptions
InvalidTemplateResourceException
Returns
string Path to partial root directory
Deprecated:
since Fluid 7; Use getPartialRootPaths() instead

Definition at line 310 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$partialRootPaths, TYPO3\CMS\Fluid\View\StandaloneView\getPartialRootPaths(), and TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

◆ getPartialRootPaths()

TYPO3\CMS\Fluid\View\StandaloneView::getPartialRootPaths ( )

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

Returns
string Fluid partial root path
Exceptions
InvalidTemplateResourceException

Definition at line 337 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$partialRootPaths.

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getPartialPathAndFilename(), and TYPO3\CMS\Fluid\View\StandaloneView\getPartialRootPath().

◆ getPartialSource()

TYPO3\CMS\Fluid\View\StandaloneView::getPartialSource (   $partialName)
protected

Resolves the path and file name of the partial file, based on $this->getPartialRootPath() and request format and returns the file contents

Parameters
string$partialNameThe name of the partial
Returns
string contents of the layout file if it was found
Exceptions
InvalidTemplateResourceException

Definition at line 489 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\getPartialPathAndFilename().

◆ getRequest()

◆ getTemplateIdentifier()

TYPO3\CMS\Fluid\View\StandaloneView::getTemplateIdentifier (   $actionName = null)
protected

Returns a unique identifier for the resolved template file This identifier is based on the template path and last modification date

Parameters
string$actionNameName of the action. This argument is not used in this view!
Returns
string template identifier
Exceptions
InvalidTemplateResourceException

Definition at line 372 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$templatePathAndFilename, TYPO3\CMS\Fluid\View\StandaloneView\$templateSource, TYPO3\CMS\Fluid\View\StandaloneView\createIdentifierForFile(), TYPO3\CMS\Fluid\View\StandaloneView\getTemplatePathAndFilename(), and TYPO3\CMS\Fluid\View\StandaloneView\getTemplateSource().

◆ getTemplatePathAndFilename()

TYPO3\CMS\Fluid\View\StandaloneView::getTemplatePathAndFilename ( )

Returns the absolute path to a Fluid template file if it was specified with setTemplatePathAndFilename() before

Returns
string Fluid template path

Definition at line 167 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$templatePathAndFilename.

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getTemplateIdentifier().

◆ getTemplateSource()

TYPO3\CMS\Fluid\View\StandaloneView::getTemplateSource (   $actionName = null)
protected

Returns the Fluid template source code

Parameters
string$actionNameName of the action. This argument is not used in this view!
Returns
string Fluid template source
Exceptions
InvalidTemplateResourceException

Definition at line 395 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$templateSource, and TYPO3\CMS\Fluid\View\AbstractTemplateView\testFileExistence().

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\getTemplateIdentifier(), and TYPO3\CMS\Fluid\View\StandaloneView\hasTemplate().

◆ hasTemplate()

TYPO3\CMS\Fluid\View\StandaloneView::hasTemplate ( )

Checks whether a template can be resolved for the current request

Returns
bool

Definition at line 354 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\getTemplateSource().

◆ resolveFileNamePath()

TYPO3\CMS\Fluid\View\StandaloneView::resolveFileNamePath (   $pathAndFilename)
protected

Wrapper method to make the static call to GeneralUtility mockable in tests

Parameters
string$pathAndFilename
Returns
string absolute pathAndFilename

Definition at line 565 of file StandaloneView.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\fixWindowsFilePath(), and TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName().

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\buildListOfTemplateCandidates().

◆ setFormat()

TYPO3\CMS\Fluid\View\StandaloneView::setFormat (   $format)

Sets the format of the current request (default format is "html")

Parameters
string$format
Returns
void

Definition at line 123 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\getRequest().

◆ setLayoutRootPath()

TYPO3\CMS\Fluid\View\StandaloneView::setLayoutRootPath (   $layoutRootPath)

Set the root path to the layouts.

Parameters
string$layoutRootPathRoot path to the layouts.
Returns
void
See also
setLayoutRootPaths()
Deprecated:
since Fluid 7; Use setLayoutRootPaths() instead

Definition at line 235 of file StandaloneView.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction(), and TYPO3\CMS\Fluid\View\StandaloneView\setLayoutRootPaths().

◆ setLayoutRootPaths()

TYPO3\CMS\Fluid\View\StandaloneView::setLayoutRootPaths ( array  $layoutRootPaths)

Set the root path(s) to the layouts.

Parameters
string[]$layoutRootPaths Root path to the layouts
Returns
void

Definition at line 248 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$layoutRootPaths.

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\setLayoutRootPath().

◆ setPartialRootPath()

TYPO3\CMS\Fluid\View\StandaloneView::setPartialRootPath (   $partialRootPath)

Set the root path to the partials. If set, overrides the one determined from $this->partialRootPathPattern

Parameters
string$partialRootPathRoot path to the partials. If set, overrides the one determined from $this->partialRootPathPattern
Returns
void
See also
setPartialRootPaths()
Deprecated:
since Fluid 7; Use setPartialRootPaths() instead

Definition at line 296 of file StandaloneView.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction(), and TYPO3\CMS\Fluid\View\StandaloneView\setPartialRootPaths().

◆ setPartialRootPaths()

TYPO3\CMS\Fluid\View\StandaloneView::setPartialRootPaths ( array  $partialRootPaths)

Set the root path(s) to the partials. If set, overrides the one determined from $this->partialRootPathPattern

Parameters
string[]$partialRootPaths Root paths to the partials. If set, overrides the one determined from $this->partialRootPathPattern
Returns
void

Definition at line 325 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$partialRootPaths.

Referenced by TYPO3\CMS\Fluid\View\StandaloneView\setPartialRootPath().

◆ setTemplate()

TYPO3\CMS\Fluid\View\StandaloneView::setTemplate (   $templateName)

Set template by name All set templateRootPaths are checked to find template by given name

Parameters
string$templateNameName of the template
Exceptions
InvalidTemplateResourceException

Definition at line 205 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$templatePathAndFilename, TYPO3\CMS\Fluid\View\StandaloneView\buildListOfTemplateCandidates(), TYPO3\CMS\Fluid\View\StandaloneView\getRequest(), TYPO3\CMS\Fluid\View\StandaloneView\setTemplatePathAndFilename(), and TYPO3\CMS\Fluid\View\AbstractTemplateView\testFileExistence().

◆ setTemplatePathAndFilename()

TYPO3\CMS\Fluid\View\StandaloneView::setTemplatePathAndFilename (   $templatePathAndFilename)

Sets the absolute path to a Fluid template file

Parameters
string$templatePathAndFilenameFluid template path
Returns
void

Definition at line 156 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$templatePathAndFilename.

Referenced by TYPO3\CMS\Backend\LoginProvider\UsernamePasswordLoginProvider\render(), and TYPO3\CMS\Fluid\View\StandaloneView\setTemplate().

◆ setTemplateRootPaths()

TYPO3\CMS\Fluid\View\StandaloneView::setTemplateRootPaths ( array  $templateRootPaths)

Set the root path(s) to the templates.

Parameters
string[]$templateRootPaths Root paths to the templates.
Returns
void

Definition at line 192 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$templateRootPaths.

◆ setTemplateSource()

TYPO3\CMS\Fluid\View\StandaloneView::setTemplateSource (   $templateSource)

Sets the Fluid template source You can use setTemplatePathAndFilename() alternatively if you only want to specify the template path

Parameters
string$templateSourceFluid template source code
Returns
void

Definition at line 180 of file StandaloneView.php.

References TYPO3\CMS\Fluid\View\StandaloneView\$templateSource.

Member Data Documentation

◆ $layoutRootPaths

TYPO3\CMS\Fluid\View\StandaloneView::$layoutRootPaths = null
protected

◆ $partialRootPaths

TYPO3\CMS\Fluid\View\StandaloneView::$partialRootPaths = null
protected

◆ $templatePathAndFilename

◆ $templateRootPaths

TYPO3\CMS\Fluid\View\StandaloneView::$templateRootPaths = null
protected

◆ $templateSource