I am new to cakePhp development. I ran into the following problem: I made several models, controllers and views - it works great. The problem is that after production I have to create a new table ( Transactionaltemp and the corresponding model and controller) in db, which is logically "connected" to other tables, but technically not required - for ex. it contains temporary information about user_id, time, ip, etc. Thus, other tables need not be directly related to this.
the problem is when I try (in a different controller than transactionaltemps_controller):
$this->loadModel('Transactionaltemp');
I get an error - the model was not found (this is true because it is missing ). Interestingly enough, it transactionaltempls_controlleris in the cache (in the file cake_controllers_list). I tried the following to solve the problem:
- clear cache
- disable cache
- tried to use the
uses={..}code in the controller that I would like to usemymodels_controller - tried to use
init('Transactionaltemp')
without success. Here is the relevant code: Model:
<?php
class Transactionaltemp extends AppModel
{
var $name = 'Transactionaltemp';
function beforeSave() {
return true;
}
}
?>
Controller:
<?php
class TransactionaltempsController extends AppController
{
var $name = 'Transactionaltemps';
var $scaffold;
}
?>
I would be very grateful for any help !!!
source
share