TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Documentation\ViewHelpers\Be\Security\IfAdminViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Documentation\ViewHelpers\Be\Security\IfAdminViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper TYPO3\CMS\Fluid\Core\ViewHelper\Facets\ChildNodeAccessInterface TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface

Public Member Functions

 render ()
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper
 setChildNodes (array $childNodes)
 
 __construct ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 

Additional Inherited Members

- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper
 renderThenChild ()
 
 renderElseChild ()
 
- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 registerArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 overrideArgument ($name, $type, $description, $required=FALSE, $defaultValue=NULL)
 
 callRenderMethod ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = NULL
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = TRUE
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! This view helper checks whether a given BE user is admin or not.

= Examples =

<doc:be.security.ifAdmin> You see this is you're an admin. </doc:be.security.ifAdmin> <output> You see this is you're an admin. (if an admin user, of course) </output>

<doc:be.security.ifAdmin> <f:then> You see this is you're an admin. </f:then> <f:else> You see this is you're not an admin. </f:else> </doc:be.security.ifAdmin> <output> Content of the "then" tag if an admin, content of the "else" tag otherwise. </output>

Definition at line 47 of file IfAdminViewHelper.php.

Member Function Documentation

◆ render()

TYPO3\CMS\Documentation\ViewHelpers\Be\Security\IfAdminViewHelper::render ( )

Renders <f:then> child if the current logged in BE user is an admin, otherwise renders <f:else> child.

Returns
string the rendered string

Definition at line 56 of file IfAdminViewHelper.php.

References $GLOBALS, TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper\renderElseChild(), and TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper\renderThenChild().