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