Download the PHP package sejator/ci4-datatables without Composer

On this page you can find all versions of the php package sejator/ci4-datatables. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ci4-datatables

📘 CI4 DataTables Helper

Library helper untuk integrasi jQuery DataTables (server-side) di CodeIgniter 4, dengan fokus:

✅ Aman
✅ Mudah dipakai
✅ Siap production

Fitur Utama

1️⃣ Penggunaan Dasar

📌 Catatan Penting

2️⃣ Dengan Filter (Where & Conditional)

Filter statis

Filter dinamis (opsional)

✔ Jika $status kosong (null, ''), filter tidak diterapkan

3️⃣ Debug SQL Lengkap (Mode Debug)

Digunakan untuk melihat seluruh query yang dipakai DataTables:

Output JSON Debug:

📌 Kegunaan debug

4️⃣ Dump SQL Langsung (Development Only)

Digunakan saat development untuk dump SQL dan menghentikan eksekusi.

Output:

⚠️ Jangan dipakai di production

5️⃣ Logging Query ke Log CI4

Query akan dicatat ke file log CI4:

📁 writable/logs/log-YYYY-MM-DD.php

Contoh log:

6️⃣ Search Aman (Whitelist Column)

📌 Wajib digunakan jika query menggunakan JOIN atau alias kolom.

Tanpa searchable(), DataTables dapat menghasilkan query tidak valid atau fitur pencarian tidak sesuai.

✔ Mencegah:

❌ Tanpa searchable():

7️⃣ Ringkasan Method Penting

Method Fungsi
from($table) Tentukan tabel
select() Kolom yang diambil
where() Filter data
when() Filter kondisional
searchable() Whitelist kolom search
orderBy() Sorting manual
debug() Tampilkan SQL lengkap
ddSql() Dump SQL & stop
logSql() Log SQL ke CI4
make() / draw() Eksekusi DataTables
withRelation() Load relasi tanpa JOIN (lazy & nested)

📌 make() dan draw() setara (pilih salah satu untuk konsistensi)

🔄 reset()

Digunakan untuk mengembalikan DataTables ke kondisi awal.

📌 Wajib dipakai jika instance digunakan lebih dari sekali

8️⃣ Relasi Data (withRelation)

Fitur withRelation() digunakan untuk memuat data relasi tanpa JOIN, sehingga:

✅ Aman untuk pagination ✅ Tidak menduplikasi row ✅ Performa lebih baik ✅ Cocok untuk server-side DataTables

Relasi akan dimuat setelah query utama dieksekusi dan disisipkan ke setiap row hasil.

8.1️⃣ Penggunaan Dasar

Hasil data:

8.2️⃣ Lazy Load Relasi (Direkomendasikan)

Relasi hanya akan di-load jika benar-benar digunakan pada addColumn() atau editColumn().

📌 Jika kolom tanggal tidak dipakai, query relasi tidak akan dijalankan.

8.3️⃣ Nested Relation (Relasi Bertingkat)

Mendukung relasi di dalam relasi.

Akses data:

8.4️⃣ Kenapa withRelation Tidak Menggunakan JOIN?

❌ JOIN menyebabkan:

✅ withRelation:

8.5️⃣ Rekomendasi Best Practice


All versions of ci4-datatables with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
codeigniter4/framework Version ^4.3 || ^4.4 || ^4.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sejator/ci4-datatables contains the following files

Loading the files please wait ...