load->helper('url'); } public function _example_output($output = null) { if (isset($output->isJSONResponse) && $output->isJSONResponse) { header('Content-Type: application/json; charset=utf-8'); echo $output->output; exit; } $this->load->view('example.php',(array)$output); } public function index() { $this->_example_output((object)array('output' => '' , 'js_files' => array() , 'css_files' => array())); } public function customers_management() { $crud = $this->_getGroceryCrudEnterprise(); $crud->setTable('Customers'); $crud->setSubject('Customer', 'Customers'); $output = $crud->render(); $this->_example_output($output); } private function _getDbData() { return [ 'adapter' => [ 'driver' => 'Pdo_Pgsql', 'database' => 'my_database_name', 'username' => 'my_username', 'password' => 'my_password' 'charset' => 'utf8' ] ]; } private function _getGroceryCrudEnterprise($bootstrap = true, $jquery = true) { $db = $this->_getDbData(); $config = include(APPPATH . 'config/gcrud-enteprise.php'); $groceryCrud = new GroceryCrud($config, $db); return $groceryCrud; } }