1

so I was adding this line to bootstrap.php

protected function _initSetDefaultKeywords() {
     $view = $this->bootstrap('view')->getResource('view');        
     $view->keywords = 'default keywords';
}

but then it would display the error

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with message 'Resource matching "view" not found

so I tried adding resources.view[] = "" to application.ini, but then when that happens, all my view helpers suddenly stop working

* s

An error occurred
Application error
Exception information:

    Message: Plugin by name 'X' was not found in the registry

how do i resolve this

current app.ini

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.defaultControllerName = "view"
resources.view[] = ""

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
1
  • could you post your current application.ini file? Commented Mar 18, 2011 at 17:58

1 Answer 1

5

Try this in your application.ini:

resources.view[] = ""
resources.view.helperPath.MyNamespace_View_Helper = "MyNamespace/View/Helper"

Make sure to change MyNamespace_View_Helper to the actual prefix of your ViewHelpers.

You may also need to add the path to your AutoloaderNamespaces variable:

autoloaderNamespaces.MyNamespace = "MyNamespace_"
Sign up to request clarification or add additional context in comments.

2 Comments

You don't need the first configuration line, the second sets up the config array for the view resource.
@Phil - Thanks, I was moreso trying to give @kamikaze_pilot reference of where the line should go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.