Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("../../vendor/autoload.php");
- use GroceryCrud\Core\GroceryCrud;
- class HomeController extends BaseController {
- public function showWelcome()
- {
- $crud = $this->getGroceryCrudEnterprise();
- $crud->setTable('customers');
- $crud->setSubject('Customer', 'Customers');
- $output = $crud->render();
- return $this->gCrudShowResponse($output);
- }
- private function getGroceryCrudEnterprise() {
- $db = include( __DIR__ . '/../config/gcrud-enterprise-db.php');
- $config = include( __DIR__ . '/../config/gcrud-enterprise.php');
- $config['xss_clean'] = false;
- $config['default_per_page'] = 50;
- $groceryCrud = new GroceryCrud($config, $db);
- return $groceryCrud;
- }
- private function gCrudShowResponse($output) {
- if ($output->isJSONResponse) {
- header('Content-Type: application/json; charset=utf-8');
- echo $output->output;
- exit;
- }
- $css_files = $output->css_files;
- $js_files = $output->js_files;
- $output = $output->output;
- $final_output = array(
- 'css_files' => $css_files,
- 'js_files' => $js_files,
- 'output' => $output
- );
- return View::make('default', $final_output);
- }
- }
Add Comment
Please, Sign In to add comment