Example #1
0
	public static function parsePagination(&$vars, $segments, $params)
	{
		$endSegment = end($segments);
		$isPaged    = preg_match('/' . preg_quote(JApplication::stringURLSafe($params->get('sef_page', 'page')) . '-') . '[0-9]*+/', $endSegment);
		if ($isPaged)
		{
			$limit              = JUDownloadHelperRoute::getLimit($vars['view']);
			$page               = $endSegment;
			$pageNumber         = substr($page, strlen(JApplication::stringURLSafe($params->get('sef_page', 'page')) . '-'));
			$vars['limitstart'] = $limit * ($pageNumber - 1);

			return true;
		}

		return false;
	}