TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StandaloneView Class Reference
Inheritance diagram for StandaloneView:
AbstractTemplateView ViewInterface 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 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 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 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 AbstractTemplateView
 $controllerContext
 
 $objectManager
 
 $templateParser
 
 $templateCompiler
 
 $baseRenderingContext
 
 $renderingStack = array()
 
 $partialIdentifierCache = array()
 

Additional Inherited Members

- Public Attributes inherited from 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 fluid/Classes/View/StandaloneView.php.

Member Function Documentation

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\resolveFileNamePath(), ArrayUtility\sortArrayWithIntegerKeys(), and AbstractTemplateView\ucFileNameInPath().

Referenced by StandaloneView\getLayoutPathAndFilename(), StandaloneView\getPartialPathAndFilename(), and StandaloneView\setTemplate().

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 fluid/Classes/View/StandaloneView.php.

Referenced by StandaloneView\getLayoutIdentifier(), StandaloneView\getPartialIdentifier(), and StandaloneView\getTemplateIdentifier().

getFormat ( )

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

Returns
string $format

Definition at line 134 of file fluid/Classes/View/StandaloneView.php.

References StandaloneView\getRequest().

Referenced by StandaloneView\getLayoutPathAndFilename(), and StandaloneView\getPartialPathAndFilename().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\createIdentifierForFile(), and StandaloneView\getLayoutPathAndFilename().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\buildListOfTemplateCandidates(), StandaloneView\getFormat(), StandaloneView\getLayoutRootPaths(), StandaloneView\getRequest(), and AbstractTemplateView\testFileExistence().

Referenced by StandaloneView\getLayoutIdentifier(), and StandaloneView\getLayoutSource().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$layoutRootPaths, StandaloneView\getLayoutRootPaths(), and GeneralUtility\logDeprecatedFunction().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$layoutRootPaths.

Referenced by StandaloneView\getLayoutPathAndFilename(), and StandaloneView\getLayoutRootPath().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\getLayoutPathAndFilename().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\createIdentifierForFile(), and StandaloneView\getPartialPathAndFilename().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\buildListOfTemplateCandidates(), StandaloneView\getFormat(), StandaloneView\getPartialRootPaths(), StandaloneView\getRequest(), and AbstractTemplateView\testFileExistence().

Referenced by StandaloneView\getPartialIdentifier(), and StandaloneView\getPartialSource().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$partialRootPaths, StandaloneView\getPartialRootPaths(), and GeneralUtility\logDeprecatedFunction().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$partialRootPaths.

Referenced by StandaloneView\getPartialPathAndFilename(), and StandaloneView\getPartialRootPath().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\getPartialPathAndFilename().

getRequest ( )
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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$templatePathAndFilename, StandaloneView\$templateSource, StandaloneView\createIdentifierForFile(), StandaloneView\getTemplatePathAndFilename(), and StandaloneView\getTemplateSource().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$templatePathAndFilename.

Referenced by StandaloneView\getTemplateIdentifier().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$templateSource, and AbstractTemplateView\testFileExistence().

Referenced by StandaloneView\getTemplateIdentifier(), and StandaloneView\hasTemplate().

hasTemplate ( )

Checks whether a template can be resolved for the current request

Returns
bool

Definition at line 354 of file fluid/Classes/View/StandaloneView.php.

References StandaloneView\getTemplateSource().

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 fluid/Classes/View/StandaloneView.php.

References GeneralUtility\fixWindowsFilePath(), and GeneralUtility\getFileAbsFileName().

Referenced by StandaloneView\buildListOfTemplateCandidates().

setFormat (   $format)

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

Parameters
string$format
Returns
void

Definition at line 123 of file fluid/Classes/View/StandaloneView.php.

References StandaloneView\getRequest().

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 fluid/Classes/View/StandaloneView.php.

References GeneralUtility\logDeprecatedFunction(), and StandaloneView\setLayoutRootPaths().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$layoutRootPaths.

Referenced by StandaloneView\setLayoutRootPath().

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 fluid/Classes/View/StandaloneView.php.

References GeneralUtility\logDeprecatedFunction(), and StandaloneView\setPartialRootPaths().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$partialRootPaths.

Referenced by StandaloneView\setPartialRootPath().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$templatePathAndFilename, StandaloneView\buildListOfTemplateCandidates(), StandaloneView\getRequest(), StandaloneView\setTemplatePathAndFilename(), and AbstractTemplateView\testFileExistence().

setTemplatePathAndFilename (   $templatePathAndFilename)

Sets the absolute path to a Fluid template file

Parameters
string$templatePathAndFilenameFluid template path
Returns
void

Definition at line 156 of file fluid/Classes/View/StandaloneView.php.

References StandaloneView\$templatePathAndFilename.

Referenced by UsernamePasswordLoginProvider\render(), and StandaloneView\setTemplate().

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$templateRootPaths.

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 fluid/Classes/View/StandaloneView.php.

References StandaloneView\$templateSource.

Member Data Documentation

$layoutRootPaths = null
protected
$partialRootPaths = null
protected
$templatePathAndFilename = null
protected
$templateRootPaths = null
protected
$templateSource = null
protected