I'm working on a web application using codeigniter and i want to use php grid in displaying information but i dont know how to do it with codeigniter! Is there anyone has worked with php grid using codeignitier? Help please!! I'm would have opted for flexigrid but it doesn't offer so much functionality such as exporting to various document format(excel, word, e.t.c). Thanx in advance!
3 Answers
I'm not familiar with php grid, but usually you can just throw a class file in application/libraries and then load it like this:
$this->load->library('phpgrid');
// and use it like this
$this->phpgrid->phpgrid_method();
2 Comments
Sam Samson
thanx.. that helps! BTW do you know how and when to use the third_party folder found in application folder of the current versions?
swatkins
Yeah, they're for packages (which are new to CI2) -- stackoverflow.com/questions/5248158/…
You can use the following code to load php datagrid or any 3rd party PHP libraries.
$this->load->library('phpgrid');
Comments
Another approach in CodeIgniter is to directly include third party libraries without calling load library.
require_once(APPPATH. 'libraries/phpGrid_Lite/conf.php');
$data['phpgrid'] = new C_DataGrid("SELECT * FROM Orders", "orderNumber", "Orders"); //$this->ci_phpgrid->example_method(3);
APPPATH is explained in this SO discussion.
