Hi
I'am going to develop an app that performs a set of CRUD operations on a set of mysql tables for an office application. I decided to integrate coddeigniter+grocerycrud into sb admin 2. I followed the tutorial available on this web site: http://www.tutorials.kode-blog.com/codeigniter-admin-panel, dowloading from the discussion a file with the whole sample (it is a package that merges codeigniter, sb admin 2, hmvc codeigniter and templates.
my controller is disigned in this way:
<?php class Tests extends Admin_Controller { function __construct() { parent::__construct(); $this->load->database(); $this->load->helper('url'); $this->load->library('grocery_CRUD'); } public function index() { $crud = new grocery_CRUD(); $crud->set_table('test'); $output = $crud->render(); $data['output'] = $output; $data['page'] = $this->config->item('ci_my_admin_template_dir_admin') . "tests_view"; $this->load->view($this->_container, $data); } }
My view is designed as:
<div id="page-wrapper"> <div class="row"> <div class="col-lg-12"> <div class="page-header users-header"> <h2>Test</h2> </div> </div> <!-- /.col-lg-12 --> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="panel panel-default"> <div class="panel-heading"> Test </div> <!-- /.panel-heading --> <div class="panel-body"> <div class="dataTable_wrapper"> <?php echo $output; ?> </div> </div> <!-- /.panel-body --> </div> <!-- /.panel --> </div> <!-- /.col-lg-12 --> </div> </div> </div> <!-- /#page-wrapper -->
but I got this error
A PHP Error was encounteredSeverity: 4096
Message: Object of class stdClass could not be converted to string
I realized that the usual call
: $output = $crud->render(); $this->_example_output($output);: public function _example_output($output = null) { $this->load->view('example.php',$output); }
is different from the new code.
Please could you help me?
Is there some developer that has tested the integration of Codeigniter+GroceryCrud with sb admin 2 (Bootstrap, jquery, etc)?
thanks in advance
Alex