Reputation: 891
I want to call a function of a component present in plugin. In my app/xyz_controller i include it as follows var $components = array('Plugin_name.Component_name'); And i call a function as- $this->Component_name->xyz(); But it doesnot work. Can any body help me where is the problem?
Upvotes: 0
Views: 2512
Reputation: 73
Not sure if this was just your example, but you should refer to plugins and components using camel case instead of underscores:
$components = array('PluginName.ComponentName');
$this->ComponentName->xyz();
This seems to work for me - I am running using Cake 1.3.
Upvotes: 1
Reputation: 2150
Have you tried requestAction?, perhaps you could use something like
$this->requestAction('/Plugin_name/Component_name/xyz');
you can get more information about requestAction at the online documentation
requestAction - CakePHP Manual
Upvotes: 0