This repository has been archived by the owner on Dec 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
1. Getting Started
Chris Nizzardini edited this page Mar 28, 2014
·
2 revisions
You can either clone the project, download the project, or just copy & paste DataTableComponent.php into your projects Controller/Component directory.
- CakePHP 2.x
- DataTables 1.9 or higher
- PHP 5.x
Add the component into your controller. For example:
class UsersController extends AppController {
public $components = array('DataTable');
}
To enable the component in all controllers edit your AppController:
class AppController extends Controller {
public $components = array('DataTable');
}
It is recommended to use JSON routing with CakePHP-Datatables, but not required. If you prefer not set up JSON routing you can use json_encode() instead.
$this->autoRender = false;
// your code here
echo json_encode($this->DataTable->getResponse());
To enable JSON routing edit your Config/routes.php file:
Router::parseExtensions('json');
how to calculate sum of at least five figures in a row