1
votes

I am having extreme issues trying to get cakephp to find a model. i been working on this project for 4 months now and created ton's of models but for some reason, cake can not find this model. This is how it is set up at minimum

app/controllers/arbitrations_controller.php

<?php
class ArbitrationsController extends AppController {
    var $name = 'Arbitrations';        
}

app/models/arbitration.php

<?php
class Arbitration extends AppModel {
    var $name = 'Arbitration';
}

database name: arbitrations

Error Message

Controller::paginate() - can't find model Arbitration in controller ArbitrationsController [CORE\cake\libs\controller\controller.php, line 1102]

I've tried clearing tmp/cache/models and tmp/cache/persistent

2
try cleaning out every single folder in /app/tmp and running the code again - Marek Sebera
is $this->Arbitration defined (in your controller)? - ori
have you make those files controller, model by your self or via console? if you have made those files manually try creating them with console. - Ehtesham
@MarekSebera I tried that several times. What i did is I went into tmp/cache/models and cleared everything in it as well as tmp/cache/persisten - numerical25
@Ehtesham I have not tried the console. I could give it a try. I just hope this doesnt happen from here on out - numerical25

2 Answers

1
votes

I got it to work. I just deleted my arbitrations_controller.php file and recreated and it worked. Must be some type of glitch or something. I think it may have had something to do with even going about deleting the tmp files and recreating the files again.

Dont know what it was, but it wasted 3 hours of my life.

1
votes

I just set this up using CakePHP v1.3.x and it worked out of the box using scaffolding. A couple of things you can try:

  1. Double check the spelling on everything. Arbitration can be easily misspelled.
  2. Add the var $uses = array('Arbitration') to the top of the controller and see if that changes anything.
  3. Double check the model spellings in the controller $this->Arbitration->recursive = -1;

If all of those things are set and working as expected it should work. Another thing to try is to load it in a clean app to see if it works in a stand alone environment.