⚠ 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

grocerycrud with a CI template



soltic
  • profile picture
  • Member

Posted 27 December 2012 - 23:33 PM

Hello,
I have a concern that this is the scenario:
I create a page template in the "views" of my application.
When loading the table in a "view" named page1.php, I get the following error:
[quote]
[b] A PHP Error was encountered[/b]

[color=#000000][font=Gill, Helvetica, sans-serif][size=3]Severity: Notice[/size][/font][/color]
[color=#000000][font=Gill, Helvetica, sans-serif][size=3]Message: Undefined variable: output[/size][/font][/color]
[color=#000000][font=Gill, Helvetica, sans-serif][size=3]Filename: backoffice/pathologie.php[/size][/font][/color]
[color=#000000][font=Gill, Helvetica, sans-serif][size=3]Line Number: 3[/size][/font][/color][/quote]


[color=#000000][font=Gill, Helvetica, sans-serif][size=3]Controller:[/size][/font][/color]

[color=#000000][font=Gill, Helvetica, sans-serif][size=3]

function index()
{
$this->grocery_crud->set_table('Pathologie');
$this->grocery_crud->unset_add_fields('Createur','InsertDate','ModificationDate','DernierModificateur');
$this->grocery_crud->unset_edit_fields('Createur','InsertDate','ModificationDate','DernierModificateur');
$this->grocery_crud->required_fields('Pathologie_ID','PathologieLib');
$this->grocery_crud->callback_after_update(array($this, 'log_pathologie_after_update'));
$this->grocery_crud->set_theme('flexigrid');
$output = $this->grocery_crud->render();
$this->_example_output($output);

}

function _example_output($output=null)

{
$data['contents'] = 'backoffice/pathologie';
$this->load->view('templates/backoffice/template', $data,$output);
}
[/size][/font][/color]

[color=#000000][font=Gill, Helvetica, sans-serif][size=3]View:[/size][/font][/color][color=#000000][font=Gill, Helvetica, sans-serif][size=3]

<div id="content" class="grid_12">
<h1>Gestion des Pathologies</h1>
<?php echo $output; ?>
</div>


Can someone help me.

victor
  • profile picture
  • Member

Posted 28 December 2012 - 11:44 AM

Hi soltic and welcome to the forum.

function _example_output($output=null)
{
$output->contents = 'backoffice/pathologie';
$this->load->view('templates/backoffice/template',$output);
}

soltic
  • profile picture
  • Member

Posted 28 December 2012 - 13:02 PM

Great Victor it works perfectly. And i follow you with your dependent dropdown library.

Thanks Victor.