Using a plugin component from a wrapper class in cakephp 2.0.2

I would like to use the plugin component from my shell class. I am trying to use:

App::import('Component', 'Myplugin.Mycomponent');
$this->Mycomponent =& new MycomponentComponent();

Unfortunately, the above seems to be failing.

And I get an error indicating that the Component class was not found.

Any suggestion how I should solve this?

thank

+1
source share
1 answer

you should always take a look at the test cases first! thus, you would know that they are manually enabled in this way:

App::uses('ComponentCollection', 'Controller');
App::uses('AppleComponent', 'Myplugin.Controller/Component');

and

$Collection = new ComponentCollection();
$Apple = new AppleComponent($Collection);

Sidenote: - , , ! lib ,

+4

All Articles