I am trying to access one of the models ( Example ) from my Component
( TestComponent ). The Example model is similar to what is shown in
cakephp example-code on page : 
http://book.cakephp.org/view/72/Additional-Methods-and-Properties

To access the Model class, I tried ClassRegistry::init method within
my component.

$this->Example = ClassRegistry::init('Example');

Now if i make call to a default method, it works fine :

$result = $this->Example->findById('10');

However, if i try to access a custom function it fails (using the same
example-code from cakephp website) :

$result = $this->Example->getRecent();

If i do pr($this->Example), I see a AppModel Object with appropriate
keys like [useTable] etc. If I turn on debug mode and look @ stack
trace then it seems as if AppModel::getRecent() was called and not the
Example::getRecent()

I would appreciate any guidance on how to do this correctly.

TIA

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to