- Introduction
Last update on 17-Sep-2012 - All Features
Last update on 17-Sep-2012 - Requirement
Last update on 17-Sep-2012 - For Beginners
Last update on 17-Sep-2012 - Must Know Necessary Things
Last update on 17-Sep-2012 - Login/Registration
Last update on 17-Sep-2012 - Site Configurations
Last update on 17-Sep-2012 - Image Resize Helper
Last update on 07-Apr-2013 - Pagination
Last update on 07-Apr-2013 - Ajax Pagination
Last update on 07-Apr-2013 - Sorting
Last update on 07-Apr-2013 - Ajax Sorting
Last update on 07-Apr-2013 - Ajax Search
Last update on 07-Apr-2013 - Ajax Form Validations
Last update on 07-Apr-2013 - Multiple Groups To User
Last update on 07-Apr-2013 - Site Page Permissions
Last update on 07-Apr-2013 - Miscellaneous
Last update on 07-Apr-2013 - Upgrade Premium Version
Last update on 07-Apr-2013 - Upgrade Free to Premium
Last update on 07-Apr-2013 - Plugin Bug Fixes
Last update on 07-Apr-2013
Sorting
Sorting is very easy in Cake Php please make sure sorting works with cake php pagination.
How to use sorting in Cake Php
1. set pagination variable in your controller for e.g. in UsersController.php
public $paginate = array(
'limit' => 25
);
2. Now in any function you should get results from Database in following way for e.g. in index function
$this->paginate = array('limit' => 10, 'order'=>'User.id desc');
$users = $this->paginate('User');
$this->set('users', $users);
3. Now in View file you should use table headers in following way-
<th><?php echo $this->Paginator->sort('User.first_name', __('Name')); ?></th>
Now this table column for Name becomes sortable.
For more information see
Users Controller yourapp/app/Plugin/Usermgmt/Controller/UsersController.php
Index View yourapp/app/Plugin/Usermgmt/View/Elements/all_users.ctp