Let's say an Company hasMany User. In www.mysite/companies/view/1 I
display company's basic information and a table with all its users
listed in it. This is of course a bit clumsy so the user table needs
to offer paging and sorting capabilities.
I searched the group and apparently CakePHP is able to paginate
related model but I'm having trouble with it.

/companies/view.ctp contains these:

$paginator->options(
            array('update'=>'UsersDiv',
                    'url'=>array('controller'=>'companies',
'action'=>'view', 'admin' => true),
                    'indicator' => 'LoadingDiv')
);

<div id = 'CompanyDetails'>
   ...
   company data here
   ...
   <div id = 'UsersDiv'>
      ...
      How should I use $paginator here to print table headers with
sorting?
      ...
      Same here, how can I print the correct paging links?
      ...
   </div>
</div>


In companies_controller.php:

function view($id = null) {
   ...
   // Is this correct?
   $users = $this->paginate('User');
}


Any help much appreciated!

--~--~---------~--~----~------------~-------~--~----~
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