Welcome Guest, Not a member yet? Register   Sign In
Calling 2 controllers?
#12

[eluser]Seppo[/eluser]
mysql_query ? mysql_num_rows?? Oh, no... That's definetly not ci-style

Why don't you add your model to the autoload config file, and inside the model constructor you call the method you need and assing those vars to the view?

Code:
class Menu extends Model {
  function Menu()
  {
    parent::Model();
    $data['menu'] = $this->getSomeData();
    $CI =& get_instance(); // not sure if necesary, but I think otherwise you mioght have problems with php 4
    $CI->load->vars($data);
  }
}


Messages In This Thread
Calling 2 controllers? - by El Forum - 05-19-2008, 03:10 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 03:17 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 03:26 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 03:34 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 04:14 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 04:15 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 05:20 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 06:03 PM
Calling 2 controllers? - by El Forum - 05-19-2008, 07:37 PM
Calling 2 controllers? - by El Forum - 05-20-2008, 01:46 AM
Calling 2 controllers? - by El Forum - 05-20-2008, 02:14 AM
Calling 2 controllers? - by El Forum - 05-20-2008, 06:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB