PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, February 17, 2022

[FIXED] Get the digit of last page in Cakephp

 February 17, 2022     cakephp, cakephp-2.0, cakephp-2.1     No comments   

Issue

How do I get just the last page number, not the link that comes with $this->Paginator->last(), but the actual digit itself?


Solution

This link will help you to achieve the same.

<?php echo $this->Paginator->counter('{:pages}');
     //counter() method with all options
     //echo $this->Paginator->counter('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}');?>

You can call the counter() method into your view to get the last page number.



Answered By - Arun Jain
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing