2 namespace TYPO3\CMS\IndexedSearch\ViewHelpers
;
5 * This file is part of the TYPO3 CMS project.
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
14 * The TYPO3 project - inspiring people to share!
17 * renders the header of the results page
19 * @author Benjamin Mack <benni@typo3.org>
22 class PageBrowsingResultsViewHelper
extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
25 * main render function
27 * @param int $numberOfResults
28 * @param int $resultsPerPage
29 * @param int $currentPage
32 public function render($numberOfResults, $resultsPerPage, $currentPage = 1) {
33 $firstResultOnPage = $currentPage * $resultsPerPage +
1;
34 $lastResultOnPage = $currentPage * $resultsPerPage +
$resultsPerPage;
35 $label = \TYPO3\CMS\Extbase\Utility\LocalizationUtility
::translate('displayResults', 'indexed_search');
36 $content = sprintf($label, $firstResultOnPage, min(array($numberOfResults, $lastResultOnPage)), $numberOfResults);