0

at first sorry my bad English

I want load model in my plugin controller

i have a controller in this path:

/app/Plugin/Services/Controller/TypesController.php

and i have a model in this path:

/app/Plugin/Services/Model/ServiceType.php

i want load ServiceType model in TypesController, i use:

$this->loadModel("ServiceType");

this command not detect my ServiceType model but this command point to my main Model pacake to this path:

/app/Model/ServiceType.php

but i want load Model in my plugin Model. Is that possible?

tereško
  • 58,060
  • 25
  • 98
  • 150
navid_gh
  • 1,863
  • 3
  • 17
  • 30

1 Answers1

0

if that is you primrary model you should be using

$uses = array('Services.ServiceType');

If not you still need to use the plugin prefix:

$this->loadModel("Services.ServiceType");
mark
  • 21,691
  • 3
  • 49
  • 71