I am working in a ZF1 project and I have created an empty controller:
application/controllers/AgreementController.php
class AgreementController
{
public function index()
{
// code goes here
}
}
I am trying to use Guriddo jqGridPHP as part of my project. They have some documentation here (go to Quick Installation) and the show something like this:
require_once 'jq-config.php';
require_once "php/jqGrid.php";
require_once "php/jqGridPdo.php";
$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
$grid = new jqGridRender($conn);
$grid->SelectCommand = 'SELECT field1, field2, field3 FROM mytable';
$grid->dataType = 'json';
$grid->setColModel();
$grid->setUrl('myfirstgrid.php');
$grid->setGridOptions(array(
"caption"=>"This is custom Caption",
"rowNum"=>10,
"sortname"=>"field1",
"rowList"=>array(10,20,50)
));
$grid->setColProperty("field1", array("label"=>"ID", "width"=>60));
$grid->renderGrid('#grid','#pager',true, null, null, true,true);
They still using require_once nowadays and that's not good for me neither the project. I am trying to find a way to autoload such library to avoid the use of require_once.
I did know about:
But I am not sure about how to deal with this. Can I get some ideas in how to achieve this?
Yes you can.
In phpgrid zf integration, a similar datagrid library, you need to modify composer.json to autoload any "old style" library:
composer.json