Download the PHP package ngekoding/codeigniter-datatables without Composer
On this page you can find all versions of the php package ngekoding/codeigniter-datatables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ngekoding/codeigniter-datatables
More information about ngekoding/codeigniter-datatables
Files in ngekoding/codeigniter-datatables
Package codeigniter-datatables
Short Description DataTables server-side for CodeIgniter
License MIT
Informations about the package codeigniter-datatables
CodeIgniter DataTables
DataTables server-side for CodeIgniter, supported for both CodeIgniter 3 and CodeIgniter 4.
Note: This library only handle the server-side part, you will still need to set up the client-side components, such as jQuery, the DataTables library, and the necessary styles. Don't worry, we've included examples below to help you get started.
Requirements
No additional requirements are needed if you are already using CodeIgniter. Simply integrate this library into your existing project.
Installation
To install the library, use Composer. This command will handle the installation process for you:
Usage
Below is a basic example of how to use this library. Feel free to customize the client-side configuration, such as defining searchable columns, orderable columns, and other DataTables options.
The usage of this library is similar for both CodeIgniter 3 and CodeIgniter 4. The primary difference is in how you create the query builder. Below are examples for both versions.
CodeIgniter 3 Example
CodeIgniter 4 Example
The above examples will give you for ajax data source (arrays), so you need to make sure the table header you makes for the client side is match with the ajax response. We will talk about the objects data source below.
Client Side Examples
You must include the jQuery and DataTables library.
Objects Data Source
As was mentioned above, the default data source we get is an arrays. It is easy also to get the objects data source.
To get objects response, you just need to call asObject()
method.
And then you can configure the client side with columns option to fit your data.
Some Others Settings
Some basic functionalities already available, here is the full settings you can doing to this library.
Use class for spesify the CodeIgniter version
Available Options
Complete Example
I already use this library to the existing project with completed CRUD operations, you can found it here.