Advertisement
Guest User

Untitled

a guest
Oct 31st, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2. namespace DADS\Library\ViewHelpers;
  3.  
  4. use TYPO3\FLOW3\Annotations as FLOW3;
  5.  
  6. /**
  7.  *
  8.  * Show account identifier, aquired through the
  9.  * security context
  10.  *
  11.  * = Examples =
  12.  *
  13.  *
  14.  * <code title="output setting value">
  15.  * <dl:accountidentifier />
  16.  * </code>
  17.  *
  18.  * <output>
  19.  * john_doe
  20.  * </output>
  21.  */
  22. class AccountIdentifierViewHelper extends \TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper {
  23.     /**
  24.      * @var \TYPO3\FLOW3\Security\Context
  25.      * @FLOW3\Inject
  26.      */
  27.     protected $securityContext;
  28.  
  29.     /**
  30.      * @return string account identifier
  31.      */
  32.     public function render() {
  33.         return $this->securityContext->getAccount()->getAccountIdentifier();
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement