problem with Tree
My model use actAs with Tree, but some thing wrong when I try to get the level path like
in PostsController call
$this->Post->getpath(...)
it shows an error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'getpath' at line 1 [CORE/cake/libs/model/datasources/dbo_source.php, line 525]
any ideas on this problem? thanks
Asked by ashong, on 2/3/10
2 Answers
Can you post the code for your model? You say that the model use "actAs" with Tree, but the variable is $actsAs, not $actAs ("acts" instead of "act"). So your class should look something like this:
class Post extends AppModel {
var $actsAs = array('Tree');
}
If you're using "var $actAs" instead of "var $actsAs", that's your problem. Basically, that error means that the "getpath" function isn't associated with your model, meaning one of two things: (A) your Post model isn't being loaded properly, or (B) the Tree behavior isn't properly associated.
Answered by jnayon 2/3/10
cake is not using the model you have created, it is using a model that is created on the fly by cake.
make sure the models are named right and in the right place
Answered by dogmatic69on 2/3/10
Rating
0
Viewed
248 times
Last Activity
on 3/3/10