I am working in a ZF1 project and I have created an empty controller:
|
1 2 3 4 5 6 7 8 9 10 |
application/controllers/AgreementController.php class AgreementController { public function index() { // code goes here } } |
I am trying to use jqGridPHP as part of my project. At documentation [here][2] (go to Quick Installation) there is an example like the one below:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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); |
The library still using require_once nowadays and that’s not good for the project. I am trying to find a way to _autoload_ the classes library to avoid the use of require_once.
I did know about:
– [ZF1 Class Loading][3]
– [Composer Autoload][4]
But I am not sure about how to deal with this. Can I get some ideas in how to achieve this?
[3]: https://framework.zend.com/manual/1.12/en/performance.classloading.html
[4]: https://getcomposer.org/doc/01-basic-usage.md#autoloading
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top