CakePHP: Why is not the Model loading correctly?

1
Model: CategoriaBanner
Controller: CategoriasBannersController

One thing is making me sleepy: When trying to use create(); it gives an object error when trying to use what would be the corresponding Model:

$this->CategoriaBanner->create();
  

Error: Call to a member function create () on a non-object File:   /meu/path/to/project/app/Controller/CategoriesBannersController.php   Line: 8

I've tried adding public $uses = 'CategoriaBanner'; but I was not successful. What could it be? Note: I am using CakePtbr to solve the inflections , and I do not want to solve with loadModel , as I want to use it by convention.     

asked by anonymous 07.06.2014 / 16:10

1 answer

1

Apparently, your solution to inflections is not working, otherwise $uses would not even be needed. Your attempt with $uses was incorrect because the value of this property must be an array. Try this:

public $uses = array('CategoriaBanner');
    
07.06.2014 / 16:56