⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to incorporate grocery crud to existing site



spreder

spreder
  • profile picture
  • Member

Posted 04 April 2020 - 03:25 AM

I have an existing website that has a LOT of template data defined as $this->data[xxx].  It is passed to the view like below:

 

class Admin extends MH_Admin_Controller  {
 
    function __construct() {
        parent::__construct();
    }  

 

   public function example() {

       $this->data['mh_admin_view']           = 'mh-admin/blank/blank';

    $this->load->view($this->config->item('mh_admin_template_dir').$this->config->item('mh_admin_template'), $this->data);

   }

}

 

How can I get grocery crud into $this->data?  thank you.

 

Regards
 

 

 

 


kevbo75217

kevbo75217
  • profile picture
  • Member

Posted 04 April 2020 - 10:51 AM

In your controller use the following right after the $output = $crud->render();

$output->mh_admin_view = 'mh-admin/blank/blank';

Then in your view add the following to show the variable

<?php echo $mh_admin_view; ?>