Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to change default cakephp paginator sorting label?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.03k
    Comment on it

    The default code of cakephp paginator sorting label.

    <?php echo $this->Paginator->sort('first_name'); ?>
    

    We can change it as follows:

    echo $this->Paginator->sort('first_name', 'First Name');

    Explanation:
    Here we can change the displayed label for CakePHP paginator:

    Let say, if we want to sort course results by course_name.

    This is how it is done by default cakephp paginator:

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

    If we want to change the displayed label:

    echo $this->Paginator->sort('course_name', 'Course/Skill Name');

    Here 'Course/Skill Name' is the label which will be displayed. course_name is the name of the column to be sorted.

 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: