Hello all, a new cakephp user and still finding my way around.
I have a User model with associated UserPhoto model (foreign key is
user_id). I am able to pull the data fine, however I wanted to use
the paginator functionality with the data to list the user, last
update date, and a count of the usuer's photos.
Everything's working normally with the default pagination:
(in my controller)
$this->set('users', $this->paginate('User') );
(in my view I have the sort column headings with)
<th><?php echo $paginator->sort('Name', 'name');?></th>
<th><?php echo $paginator->sort('Update Date', 'last_update');?></th>
I did not expect this to work (and it doesn't) but it gives the idea
of what I want to do
<th><?php echo $paginator->sort('Number of Pics',
'count(UserPhoto.id)');?></th>
However I want to allow sorting on the pagination with the count, is
that possible? I've done numerous searches with regards to custom
queries and the paginator, but for some maybe I'm being a bit obtuse
and can't see how to do what I want to do.
Thanks in advance,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---