Load a model from an advanced module into a fuel_block

edited August 2011 in Modules
Hello again,

So here it is..

I have a view created in the application folder and i want to load the rent_model from the anunturi advanced module.

This is how i used it to load a model from my simple module.
<h1> anunturi rent</h1> <?=fuel_block(array('view'=>'rent_categories','model'=>'rent_categories_','find'=>'all'))?>
and this is how I`m trying to load the model from the advanced module... Is this possible?
<h1> anunturi rent advanced </h1> <?=fuel_block(array('view'=>'rent_categories2','model'=>'rent','find'=>'all'))?>

Comments

  • edited 12:44PM
    The fuel_block function is currently only setup to pull from your application directory. I'll put it on the list of things to look though for future update.

    For now, you can just use the $this->load->module_view('anunturie', '_blocks/rent_categories2', $vars)....
  • edited August 2011
    So, I should use it somehow like this? Am I right?

    $CI->load->model('anunturi/rent_model','rent'); $rent=$CI->rent->find_all(); $vars=array('rent'=>$rent); $this->load->module_view('anunturi', '_blocks/rent_categories2',$vars);

    Is there any other way?
    Thank you.
  • edited 12:44PM
    This is working too :D
    $rent = fuel_model('anunturi_rent', array('find' => 'all','module'=>'anunturi')); $vars=array('rent'=>$rent); $this->load->module_view('anunturi', '_blocks/rent_categories2',$vars);
  • edited 12:44PM
    yep... both of those should be fine.
Sign In or Register to comment.