CodeExplorer sBuildLink example
protected function addLinksToFilter(array
$filterData,
$requestParameterName,
$requestParameterValue,
$addRemoveProperty = true
) { foreach ($filterData as $key =>
$dateData) { $filterData[$key]['link'
] =
$this->blogBaseUrl .
Shopware()->
Modules()->
Core()->
sBuildLink( ['sPage' => 1,
$requestParameterName =>
urlencode($dateData[$requestParameterValue])] );
} if ($addRemoveProperty) { $filterData[] =
[ 'removeProperty' => 1,
'link' =>
$this->blogBaseUrl .
Shopware()->
Modules()->
Core()->
sBuildLink(['sPage' => 1,
$requestParameterName => ''
]),
];
} return $filterData;
} public function getPagerStructure($destinationPage,
$numberOfPages,
$additionalParams =
[]) { $destinationPage = !
empty($destinationPage) ?
$destinationPage : 1;
$pagesStructure =
[];
$baseFile =
$this->config->
get('sBASEFILE'
);
if ($numberOfPages > 1
) { for ($i = 1;
$i <=
$numberOfPages; ++
$i) { $pagesStructure['numbers'
][$i]['markup'
] =
$i ==
$destinationPage;
$pagesStructure['numbers'
][$i]['value'
] =
$i;
$pagesStructure['numbers'
][$i]['link'
] =
$baseFile .
$this->moduleManager->
Core() ->
sBuildLink($additionalParams +
['sPage' =>
$i]);
} // Previous page
if ($destinationPage != 1
) { $pagesStructure['previous'
] =
$baseFile .
$this->moduleManager->
Core() ->
sBuildLink($additionalParams +
['sPage' =>
$destinationPage - 1
]);
} else { $pagesStructure['previous'
] = null;
} // Next page
if ($destinationPage !=
$numberOfPages) { $pagesStructure['next'
] =
$baseFile .
$this->moduleManager->
Core()