TYPO3 CMS  TYPO3_6-2
ActionMenuItemViewHelper.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $tagName = 'option';
26 
37  public function render($label, $controller, $action, array $arguments = array()) {
38  $uriBuilder = $this->controllerContext->getUriBuilder();
39  $uri = $uriBuilder->reset()->uriFor($action, $arguments, $controller);
40  $this->tag->addAttribute('value', $uri);
41  $currentRequest = $this->controllerContext->getRequest();
42  $currentController = $currentRequest->getControllerName();
43  $currentAction = $currentRequest->getControllerActionName();
44  $currentArguments = $currentRequest->getArguments();
45  unset($currentArguments['action']);
46  unset($currentArguments['controller']);
47  unset($currentArguments['redirect']);
48 
49  if ($action === $currentAction && $controller === $currentController && $currentArguments === $arguments) {
50  $this->tag->addAttribute('selected', 'selected');
51  }
52  $this->tag->setContent($label);
53  return $this->tag->render();
54  }
55 
56 }
render($label, $controller, $action, array $arguments=array())