views:

203

answers:

2

I am trying to load a Plugin but I get the following error:

Fatal error: Class 'Site_Plugin_ViewSetup' not found in C:\dev\library\Zend\Application\Resource\Frontcontroller.php on line 92

I configured the file (last line):

[production]
includePaths.library = APPLICATION_PATH "/../lib"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.layout.layout = "layout"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
resources.frontController.plugins.viewsetup = "Site_Plugin_ViewSetup"

And in \lib\Site\Plugin I have ViewSetup.php

class Site_Plugin_ViewSetup extends Zend_Controller_Plugin_Abstract
{ ... }

I looked at zend docs but could not fid how to properly load a plugin. Does it have to be in the 'library' directory or could I place the 'plugin' folder in the same directory where my 'views' and 'controllers' folders are.

UPDATE I added autoloaderNamespaces and it worked.

autoloaderNamespaces[] = "site" resources.frontController.plugins.viewsetup = "site_Plugin_ViewSetup"

I don't get why it worked since I already had "site_" in class name.

A: 

You should be able to just put it in the Site/Plugin/ViewSetup.php file in your library.

Franz
+2  A: 

Actually you can add this line to your ini: autoloaderNamespaces[] = "Site_"

Chris