Hi,
It should be in the main directory.
CI 3 already has the composer.json file as default.
when you run "composer install" it will create a vendor file.
Code:
"require-dev": {
"mikey179/vfsStream": "1.1.*",
"phpunit/phpunit": "4.* || 5.*"
}
and because of this section exists it installs some test suits for you. (if you dont want to use these, you can remove them. and run "composer update" to update vendor folder.)
Still if you don't want to use composer, and only if you insist, these instructions are for you.
1- Download github repo.
2- Copy src folder into your
application/libraries folder,
3- rename it to
Datatables from
src
4- create a new file called Datatables.php in the
application/libraries folder
5- copy the codes below and save it.
Datatables.php
PHP Code:
<?php
include_once "Datatables/Datatables.php";
include_once "Datatables/DB/DatabaseInterface.php";
include_once "Datatables/DB/CodeigniterAdapter.php";
use Ozdemir\Datatables\Datatables as DT;
use Ozdemir\Datatables\DB\CodeigniterAdapter;
class Datatables extends DT {
function __construct()
{
parent::__construct(new CodeigniterAdapter);
}
}
and in your controller usage will be simply like this :
PHP Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function index()
{
$this->load->view('welcome_message');
}
public function ajax()
{
$this->load->library('Datatables');
$dt = $this->datatables->query("select name, surname, phone, address from users");
echo $dt->generate();
}
}
I hope it helps you :
(with this, I think you can run it with CI 2.0 too.)
Regards