I am trying to construct an application from various plugins. I would
like to call a particular function that resides within a plugin from a
main application controller.
My plugin controller looks like this:
<?php
class PluginexampleAppController extends AppController {
public function blaablaaBingBing(){
return "unite the factions";
}
}
?>
My application controller looks like this (I am calling it from within
the index just to get the concept working):
<?php
App::uses('AppController', 'Controller');
App::import('Controller', 'Pluginexample');
class PeopleController extends AppController {
public function index() {
$Example = new PluginexampleAppController();
$Example->constructClasses();
$returnedValue = $Example->blaablaaBingBing();
debug($returnedValue);
$this->Person->recursive = 0;
$this->set('people', $this->paginate());
}
I have included CakePlugin::loadAll(); in my bootstrap.php
And I am getting this error: //Fatal error: Class
'PluginexampleAppController' not found in /home/gardiner/projectsPHP/
farmersBarn/app/Controller/PeopleController.php on line 20//
In an effort to get the People controller to call a function in the
Pluginexample controller I sourced the following questions:
1. Am I loading the plugin controller correctly?
2. Am I calling the plugin controllers function correctly?
3. I have tried to use the request action, it also gives me an error -
is there a better way to call the plugins controller function?
Thank you in advance for your input and help with this problem.
--
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
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php