Unset argument after evaluation
This commit is contained in:
@@ -58,17 +58,24 @@ class AjaxViewHelper extends ActionViewHelper
|
||||
RenderingContextInterface $renderingContext
|
||||
)
|
||||
{
|
||||
// Determine page type from format argument
|
||||
if (strtolower(trim($arguments['format'])) === 'json') {
|
||||
$arguments['pageType'] = self::PAGE_TYPE_JSON;
|
||||
} else {
|
||||
$arguments['pageType'] = self::PAGE_TYPE_HTML;
|
||||
}
|
||||
|
||||
// Unset argument to keep it out of resulting url
|
||||
$arguments['format'] = '';
|
||||
|
||||
// Use current page uid as target unless provided
|
||||
if ($arguments['pageUid'] === null) {
|
||||
$rootLine = $GLOBALS['TSFE']->sys_page->getRootLine($GLOBALS['TSFE']->id);
|
||||
$rootPage = array_pop($rootLine);
|
||||
$arguments['pageUid'] = $rootPage['uid'];
|
||||
}
|
||||
|
||||
// Force absolute urls
|
||||
$arguments['absolute'] = true;
|
||||
|
||||
return parent::renderStatic($arguments, $renderChildrenClosure, $renderingContext);
|
||||
|
||||
Reference in New Issue
Block a user