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)