PHP code example of nongbit / codeigniter-datatable
1. Go to this page and download the library: Download nongbit/codeigniter-datatable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nongbit / codeigniter-datatable example snippets
namespace App\Controllers;
use App\Models\UserModel;
use Nongbit\DataTable\Traits\DataTableTrait;
class UserController extends BaseController
{
use DataTableTrait;
public function datatable()
{
$model = new UserModel();
$builder = $model->builder();
$dt = $this->getDatatable($builder);
return $this->response->setJSON($dt->toArray());
}
}