protected function getTypoScriptPathForCurrentRequest()
{
if ($this->typoScriptPath === null) {
$typoScriptPath = $this->getOption('typoScriptPath');
if ($typoScriptPath !== null) {
$this->typoScriptPath = $typoScriptPath;
} else {
/** @var $request ActionRequest */
$request = $this->controllerContext->getRequest();
$typoScriptPathForCurrentRequest = $request->getControllerObjectName();
$typoScriptPathForCurrentRequest = str_replace('\\Controller\\', '\\', $typoScriptPathForCurrentRequest);
$typoScriptPathForCurrentRequest = str_replace('\\', '/', $typoScriptPathForCurrentRequest);
$typoScriptPathForCurrentRequest = trim($typoScriptPathForCurrentRequest, '/');
$typoScriptPathForCurrentRequest .= '/' . $request->getControllerActionName();
$this->typoScriptPath = $typoScriptPathForCurrentRequest;
}
}
return $this->typoScriptPath;
}