Hi. Thank you, again, for helping.
I have a basic model (Topic), with functions, e.g., MyFunction(), and
another model that is a behavior (TopicTree), based on the same underlying
table:
public $useTable = 'topics';
public $name = 'TopicTree';
public $actsAs = array('Tree');
So, in the TopicTreesController I would like to access some of the
functions in the Topic model.
Now, I know if I have associated tables and, therefore, models (e.g., my
Clause model, with a one-to-one association to Tree), I can access Topic
functions with $pd = $this->Clause->Topic->MyFunction(); but that does not
seem to work with this related behavior model.
I have tried, but failed with:
$pd = $this->Topic->MyFunction();
$pd = $this->TopicTree->Topic->MyFunction();
$pd = $this->Topic->TopicTree->MyFunction();
Reading somewhere, I did get this to work:
$pd = ClassRegistry::init('Topic')->MyFunction();
... I just don't know if that is the ideal way of doing this. I have to
call the above four or five times from the TopicTreesController.
Is this where I would use loadModel or uses, etc.?
Thank you!!!
Kevin
--
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].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.