Since version 2.2, dhtmlxConnector has been updated to work with latest versions of frameworks (CodeIgniter, Yii and CakePHP) and started supporting integration with the Laravel framework. You can built web applications with your favorite frameworks and still use dhtmlxConnector.
In case you need information on integration of dhtmlxConnector with the earlier versions of frameworks, you can read the chapter Using Connector with Frameworks (version 1.5).
In this article you will find useful tips on the usage of dhtmlxConnector in your apps created with one of the listed frameworks. The detailed information is given in the related tutorials:
For example, let's consider creating an app that presents a grid loaded with data from db. The app is built with one of the frameworks and uses dhtmlxConnector to load data in.
Model:
Doesn't have any specificity and created as usual.
View:
mygrid = new dhtmlXGridObject('grid_here');
...
mygrid.init();
mygrid.load("./data"); //refers to the 'data' action
var dp = new dataProcessor("./data"); //refers to the 'data' action as well
dp.init(mygrid);
//sample code for the Laravel framework
<?php
namespace App\Http\Controllers;
use App\SchedulerEvent;
use Dhtmlx\Connector\GridConnector;
class GridController extends Controller
{
public function data() {
$connector = new GridConnector(null, "PHPLaravel");
// the SchedulerEvent() method is used to create the model
$connector->configure(
new SchedulerEvent(),
"event_id",
"start_date, end_date, event_name"
);
$connector->render();
}
}
//sample code for the CodeIgniter framework
<?php
use Dhtmlx\Connector\GridConnector;
class Grid extends CI_Controller {
public function index(){
$this->load->view("GridView");
}
public function data(){
$this->load->database(); // data feed
$connector = new GridConnector($this->db, "PHPCI");
$connector->configure(
"scheduler_events",
"event_id",
"start_date, end_date, event_name"
);
$connector->render();
}
};
Back to top