drpudding (4) [Avatar] Offline
#1
I am using ZF 1.8 and have migrated much of the app set up to my config file, using:

$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);

I am trying to register the ActionSetup plugin, but am not sure if this can be done via the config file in a manner similar to resource plugins. For resource plugins, I am able to set my namespace, then the pluginPaths as:
pluginPaths.Mac_Resource_Plugins = LIBRARY_PATH "/Mac/Resource/Plugins"
then register a new resource plugin as:
resources.someresourceplugin = true

Is a similar setup possible for front controller plugins?

In the absence of that, I'm a little unclear how to register them under 1.8

I have tried to register the plugin in my bootstrap file like this, but it isn't able to locate it:

protected function _initFrontControllerPlugins() {

$fc = Zend_Controller_Front::getInstance();
$fc->registerPlugin(new Mac_Controller_Plugin_ActionSetup(), 9smilie;

}

Thanks for any help here!
drpudding (4) [Avatar] Offline
#2
Re: Problem Registering the ActionSetup plugin
This has been solved using:
resources.frontcontroller.plugins.ActionSetup = "Mac_Controller_Plugins_ActionSetup"
akrabat (479) [Avatar] Offline
#3
Re: Problem Registering the ActionSetup plugin
Well done smilie

Rob...
chinaski (4) [Avatar] Offline
#4
Re: Problem Registering the ActionSetup plugin
I'm trying to get a simple Helloworld application going using the new Bootstrapping/application.ini setup.

I'm trying to get an action plugin working and am getting a Class not found error.

So this is the line I have in the application.ini:

resources.frontcontroller.plugins.ActionSetup = "Helloworld_Controller_Plugins_ActionSetup"

/in/include/path/library/Helloworld/Controller/Plugins/ActionSetup.php has the requisite class:
class Helloworld_Controller_Plugins_ActionSetup extends Zend_Controller_Plugin_Abstract

Error: Class 'Helloworld_Controller_Plugins_ActionSetup' not found

Suggestions?
akrabat (479) [Avatar] Offline
#5
Re: Problem Registering the ActionSetup plugin
Hi,

You need a file called ActionSetup.php in the folder libraryHelloworldControllerPlugin. Within this file, you need a class called Helloworld_Controller_Plugins_ActionSetup.

You'll also need this line in your application.ini:
autoloadernamespaces[] = "Helloworld_"


Regards,

Rob...
chinaski (4) [Avatar] Offline
#6
Re: Problem Registering the ActionSetup plugin
Thanks for the reply.

I'm still a bit confused, just trying to get the same functionality from the book, i.e. the ActionSetup.php controller plugin, with the new application bootstrapping stuff.

Now I'm getting an uncaught exception error in Bootstrap.php:

'No default controller directory registered with front controller'

I have the following in the development section of the application.ini file:


includePaths.library = "c:/home/php_includes/helloworld/library"
resources.frontController.controllerDirectory = "c:/home/php_includes/helloworld/application/controllers"
autoloadernamespaces[] = "Helloworld_"
bootstrap.path = "c:/home/php_includes/helloworld/application/Bootstrap.php"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"

resources.frontcontroller.plugins.ActionSetup = "Helloworld_Controller_Plugins_ActionSetup"