Hello,
trying to integrate phpgrid into cakephp application.
Grid fails on initialization
$g = new jqgrid($db_conf);
Any help greatly appreciated.
Thanks,
Leo
What i recommend is to place the lib/inc folder in “plugins/phpgrid/lib/inc”.
Then in controller, you can have: e.g.
namespace App\Controller;
use Cake\Core\Configure;
use Cake\Http\Exception\ForbiddenException;
use Cake\Http\Exception\NotFoundException;
use Cake\View\Exception\MissingTemplateException;
use Cake\Event\Event;
require_once(ROOT . DS . ‘plugins’ . DS . ‘phpgrid’ . DS . ‘lib’ . DS . ‘inc’ . DS . ‘jqgrid_dist.php’);
use jqgrid;
and later you can have controller method using this object.
public function grid()
{
// Database config file to be passed in phpgrid constructor
$db_conf = array(
“type” => “mysqli”,
“server” => “127.0.0.1”,
“user” => “root”,
“password” => “”,
“database” => “test”
);
$g = new jqgrid($db_conf);
…
}