Yes, this is just being used by the one model. (If it was being used by more, then where would I put it?)
-- So, per your instruction, I placed $this->TopicTree->getLevel($id); in one of my controller functions and successfully call it from a view. It in turn successfully passes the id and calls the function (confirmed by debug) I have in my model. But the function, when places in the model, does not return any data as it did when it was placed in the controller. What am I missing? I'm very new, so it will be very obvious!
Here, as above, is the function, in TopicTree model, I'm successfully calling from my controller.
public function getlevel($id=null) {
$count = count($this->TopicTree->getPath($id,array('TopicTree.id')))-1;
return $count;
}
Is the problem that the function, now that it is in the model and not the controller, does not know which data to access?
I do, so very much, appreciate your help.
Kevin
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment