⚠ 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

Paasing GC and some extra data into view through array



sourov08
  • profile picture
  • Member

Posted 27 October 2014 - 14:43 PM

I was trying to pass some extra values of data on grocery crud view when I came up with the following solution.
 
This is my controller :
 
$crud = new grocery_CRUD();
$crud->set_table('tickets');
$crud->set_subject('Order');
$output = $crud->render();
 
       $data = array(
    'title' => "Unsolved Tickets ! ",                      
       'page_heading' => "Unsolved tickets ! ",                      
       'output'      =>  $output,
       );      
 
$this->load->view('example',$data);  
 
and this is my view file :
<?php  
foreach($output->css_files as $file): ?>
<link type="text/css" rel="stylesheet" href="<?php echo $file; ?>" />
<?php endforeach; ?>
 
 
<?php foreach($output->js_files as $file):  ?>
<script src="<?php echo $file; ?>"></script>
<?php endforeach; ?>
 
                        <?php echo $output->output;   ?>