Template 

\nn\t3::Template() 

Render fluid templates and manipulate paths to templates in the view.

Overview of Methods 

\nn\t3::Template()->findTemplate($view = NULL, $templateName = ''); 

Finds a template in an array of possible templatePaths of the view

\nn\t3::Template()->findTemplate( $this->view, 'example.html' );
Copied!

| @return string

| ➜ Go to source code of Template::findTemplate()

\nn\t3::Template()->getVariable($view, $varname = ''); 

Fetches ONE variable of the current view, i.e: Everything that was set via assign() and assignMultiple().

In the ViewHelper:

\nn\t3::Template()->getVariable( $renderingContext, 'varname' );
Copied!

In the controller:

\nn\t3::Template()->getVariable( $this->view, 'varname' );
Copied!

| @return array

| ➜ Go to source code of Template::getVariable()

\nn\t3::Template()->getVariables($view); 

Retrieves the variables of the current view, i.e: Everything that was set via assign() and assignMultiple().

In the ViewHelper:

\nn\t3::Template()->getVariables( $renderingContext );
Copied!

In the controller:

\nn\t3::Template()->getVariables( $this->view );
Copied!

| @return array

| ➜ Go to source code of Template::getVariables()

\nn\t3::Template()->mergeTemplatePaths($defaultTemplatePaths = [], $additionalTemplatePaths = []); 

Merge paths to templates, partials, layout

\nn\t3::Template()->mergeTemplatePaths( $defaultTemplatePaths, $additionalTemplatePaths );
Copied!

| @return array

| ➜ Go to source code of Template::mergeTemplatePaths()

\nn\t3::Template()->removeControllerPath($view); 

Removes the path of the controller name, e.g. /Main/... from the search for templates.

\nn\t3::Template()->removeControllerPath( $this->view );
Copied!

| @return void

| ➜ Go to source code of Template::removeControllerPath()

\nn\t3::Template()->render($templateName = NULL, $vars = [], $templatePaths = [], $request = NULL); 

Render a Fluid template using the standalone renderer

\nn\t3::Template()->render( 'Templatename', $vars, $templatePaths );
\nn\t3::Template()->render( 'Templatename', $vars, 'myext' );
\nn\t3::Template()->render( 'Templatename', $vars, 'tx_myext_myplugin' );
\nn\t3::Template()->render( 'fileadmin/Fluid/Demo.html', $vars );
Copied!

Since TYPO3 12, the $request must also be passed when calling from a controller:

\nn\t3::Template()->render( 'templatename', $vars, $templatePaths, $this->request );
Copied!

| @return string

| ➜ Go to source code of Template::render()

\nn\t3::Template()->renderHtml($html = NULL, $vars = [], $templatePaths = [], $request = NULL); 

Render simple fluid code via standalone renderer

\nn\t3::Template()->renderHtml( '{_all->f:debug()} Test: {test}', $vars );
\nn\t3::Template()->renderHtml( ['Name: {name}', 'Test: {test}'], $vars );
\nn\t3::Template()->renderHtml( ['name'=>'{firstname} {lastname}', 'test'=>'{test}'], $vars );
Copied!

Since TYPO3 12, the $request must also be passed when calling from a controller:

\nn\t3::Template()->renderHtml( 'templatename', $vars, $templatePaths, $this->request );
Copied!

| @return string

| ➜ Go to source code of Template::renderHtml()

\nn\t3::Template()->setTemplatePaths($view = NULL, $defaultTemplatePaths = [], $additionalTemplatePaths = []); 

Sets templates, partials and layouts for a view. $additionalTemplatePaths can be passed to prioritize paths

\nn\t3::Template()->setTemplatePaths( $this->view, $templatePaths );
Copied!

| @return array

| ➜ Go to source code of Template::setTemplatePaths()

Methods