I got something strange.
Let say I have to models M1 and M2. They have no association. Their
controllers are C1 and C2.
M1 has a custom method for saving datas. In this saving method I have
to call M2->calculate() method.
(1) First I tried to add to C1:
var $uses = array('M2');
When I did this all my actions dies:
Undefined property: C1Controller::$M1 [APP/controllers/
C1_controller.php, line X]
(2) The manual says I do not have to add directly the controllers own
model to do $uses array, but I did.
var $uses = array('M1', 'M2');
In this case I do not get the error above, but when I try to save my
datas by my custom method in M1 I get this:
Undefined property: M1::$M2 [<b>APP/models/M1.php, line Y
This line Y is the calling of M2 model's calculate method:
$this->M2->calculate();
Am I doing something wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---