Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to rename a column of paginator sorting in cakephp?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 106
    Comment on it

    This blog will help you to modify the column name of paginator sorting. I am writing this blog specially for beginners as I was also facing this small issue. If you want to rename the column then you need to pass second parameter as desired column name in cakephp 2.X.

    Assuming you are paginating some data and you are writing this code on view page:

    echo $this->Paginator->sort('modified');
    

    Output:

    <a href="/posts/index/page:1/sort:modified/direction:asc/">Modified</a>

    You can use the title parameter to create custom text for your link:

    <?php echo $this->Paginator->sort('modified','Last Modified'); ?>

    Output:

    <a href="/posts/index/page:1/sort:modified/direction:asc/">Last Modified</a>

     

    That's all!

    Thanks for reading the blog.

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: