[Flow] How to determine the currently called controller
Christian Loock
brainshack at gmail.com
Mon Mar 10 10:01:55 CET 2014
Ok, I figured out the following by myself:
First, I inject the MVC Router:
/**
* @Flow\Inject
* @var \TYPO3\Flow\Mvc\Routing\RouterInterface
*/
protected $router;
Then i use it to determine the current actionrequest like this:
$request = \TYPO3\Flow\Http\Request::createFromEnvironment();
$this->actionRequest = $this->router->route($request);
I'm not sure if it is the best way to do it though. If there is a better
way, please let me know.
Cheers,
Christian
2014-03-10 9:22 GMT+01:00 Christian Loock <brainshack at gmail.com>:
> Hello,
>
> inside my ViewHelper i need to know which Action/Controller/Package is
> currently being called (to determin the active state of a Menu item).
>
> I tried to create an ActionRequest like this:
>
> \TYPO3\Flow\Http\Request::createFromEnvironment()->createActionRequest()
>
> But the ActionRequest will always return NULL when i try to call controller
> Information.
>
> What is the best way to get those informations outside of a
> ActionController?
>
> Thanks in advance,
>
> Christian
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
More information about the Flow
mailing list