Hi All,

I have just had a look through the groups, and tried a couple of
things suggested, but for some reason I can't get the paginator
working properly still.

This is my controller:

************************************** CONTROLLER
***************************************

class MessagesController extends AppController
        {
                var $name = 'Messages';
                var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
                var $uses = array('Message');

                var $paginate = array(
                        'Message' => array(
                                'limit' => 1,
                                'order' => array(
                                        'Message.created' => 'desc',
                                        'Message.message_status_id' => 'asc',
                                        'Message.importance' => 'asc'
                                )
                        )
                );


                function inbox()
                {
                        $this->set('data', 
$this->Message->findAll('Message.user_id = ' .
$this->Auth->user('id') . ' AND Message.message_status_id IN (1, 2)',
null, 'Message.message_status_id, Message.importance, Message.created
DESC'));
                }
}

*********************************************************************************

And then my view:

************************************** VIEW
***************************************

<table cellspacing="0">
                <tr>
                        <th>&nbsp;</th>
                        <th>
                                Date
                                <?php

                                        if ($paginator->sortKey() == 'created')

                                        {

                                                switch ($paginator->sortDir())

                                                {

                                                        case 'asc':

                                                                $currDir = 
'asc';

                                                                $newDir = 
'desc';

                                                                break;

                                                        case 'desc':

                                                                $currDir = 
'desc';

                                                                $newDir = 'asc';

                                                                break;

                                                }

                                        }

                                        else

                                        {

                                                $currDir = 'asc';

                                                $newDir = 'desc';

                                        }

                                ?>

                                <a href="<?php echo $html->url(array('action' 
=> 'inbox')).'/
page:'.$paginator->current().'/sort:created/direction:'.$newDir; ?>">

                                        <img src="/img/themes/default/<?php 
echo $currDir; ?>.gif"
alt="Sort Direction" />

                                </a>
                        </th>

...

*********************************************************************************

Is there any reason why this wouldn't be working? Everything seems to
be as people suggest..

Any help would be greatly appreciated. :)

Thanks

Patrick
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to