By Zeosing on Monday, 21 May 2018
Posted in Technical Issues
Likes 0
Views 731
Votes 0
Hi, we need to detect the last number in pagination .

For example in blogs/pagination/default.php the las link outputs with :


echo $data->end->link


Any possibility to instead output the link , output the number of page ( last one ) ?

Thanks.
I am not entirely sure of what you are trying to achieve here but the pagination object has a property called "pages". You could see if that is what you are trying to obtain,

[gist]
var_dump($data->pages);
[/gist]
·
Monday, 21 May 2018 22:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi, we need only the last page number,

For example when use :


$data->end->link


Output is :


/noticias/primer-equipo-masculino?start=5


So the last page is ?start=5

It´s possible to obtain only the last page number ?

Thanks.
·
Tuesday, 22 May 2018 00:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Zeosing,

From the data object itself, it is not possible to directly get the last page number. However, since you already able to get the last page link, you can find any php function to get only the last number from that link.
·
Tuesday, 22 May 2018 09:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi, Nik, you´re right, thanks
·
Tuesday, 22 May 2018 14:12
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Tuesday, 22 May 2018 17:22
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post