• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I have a problem with new module

#1
[eluser]huutri[/eluser]
I cannot use $this->load->module_model in view in new my module. Please help me

#2
[eluser]JHackamack[/eluser]
Load the model in the controller and call it in the view.

Controller:
$this->load->model('model_name');


View:
$this->model_name->function($params);

#3
[eluser]huutri[/eluser]
I have problem in load model with PyroCMS. I use $this->load->module_model in view in new my module but it can not work. Can you help me

#4
[eluser]Phil Sturgeon[/eluser]
Could you give more detail on what is "not working"? Is it white screen, error message or did your monitor explode?

#5
[eluser]huutri[/eluser]
This is code in view layer in new my module:
$this->load->module_model('productcategories','mproductcategories');
$listcate = $this->mproductcategories->GetAllCategories('vn');

I get a error: "A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$mproductcategories
Filename: views/index.php"

"Fatal error: Call to a member function GetAllCategories() on a non-object"

Can you explain to me how to call a function in model from view layer in a module. Thanks you very much

#6
[eluser]huutri[/eluser]
I also another problem: I can not call a function in model to view in sam module with PyroCMS. Can you help me??


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.