Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3949616
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:30:52+00:00 2026-05-20T01:30:52+00:00

I have a few view helpers that add JavaScript files when they’re needed (for

  • 0

I have a few view helpers that add JavaScript files when they’re needed (for instance, so that only forms use CKEditor and such). My directory structure (simplified to include only the relevant files) is this:

application
    --forms
        --Project
            AddIssue.php
    --modules
        --default
            --views
                --helpers
                    JQueryUI.php
                    Wysiwyg.php
        --project
            --controllers
                ProjectController.php
            --views
                --scripts
                    --project
                        version.phtml
                        issueadd.phtml

What I want to do:

  1. include CKEditor in the view project/project/issueadd
  2. include jQuery UI in project/project/version

When I’m inside the view script, calling <?php $this->jQueryUI(); ?> works like a charm, even though the helper is in the default module’s helpers directory. However, the same is not true for the controller and the form.

In the controller ProjectController.php, versionAction(), I tried to call:

$this->view->jQueryUI();

and the effect was an exception:

Message: Plugin by name ‘JQueryUI’ was not found in the registry; used paths: Project_View_Helper_: C:/xampp/htdocs/bugraid/application/modules/project/views\helpers/ Zend_View_Helper_: Zend/View/Helper/

Similarly, in the AddIssue.php form, I tried this:

$this->getView()->wysiwyg();

and there was an exception again:

Message: Plugin by name ‘Wysiwyg’ was not found in the registry; used paths: Project_View_Helper_: C:/xampp/htdocs/bugraid/application/modules/project/views\helpers/ Zend_View_Helper_: Zend/View/Helper/

Obviously, both would work if my view helpers were in the helper directories of the modules/controllers they’re being called from, but since they’re used across many modules, I’d like to have them in the default module’s view helpers directory.

So, my questions are:

  1. How do I access those view helpers from within the controller and the form?
  2. Is there a simpler way to get around this (apart from simply including all javascript files in the layout)? Like creating a plugin or an action helper? (I haven’t done these things before, so I really don’t know, I’m only starting my adventure with ZF).
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:30:53+00:00Added an answer on May 20, 2026 at 1:30 am

    Regarding Q1 (based on the comments). You should be able to access the helpers in a usual way. However since it does not work, I think there is a problem with the way you bootstrap your view resource and/or the way how you perform concrete registration of the helpers or how you add helper path to it. I paste an example of adding helper path in Bootsrap.php:

    <?php
    #file: APPLICATION_PATH/Bootstrapt.php
    
    class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
    
        public function _initViewHelperPath() {
    
            $this->bootstrap('view');
            $view = $this->getResource('view');
    
              $view->addHelperPath(
                    APPLICATION_PATH . '/modules/default/views/helpers',
                    'My_View_Helper' // <- this should be your helper class prefix.
            );
        }
    
    }
    ?>
    

    This off course should normally work for modular setup of ZF.

    Regarding Q2:
    You can use headScript view helper to manage what scripts do you load in the head tag of your layout. Using this helper you can do it from your actions.

    For example. If in a layout.php you have:

    <head>
        <?php echo $this->headScript(); ?>
    </head>
    

    then in, e.g. indexAction you can append some JS file as follows:

    $this->view->headScript()->appendFile($this->view->baseUrl('/js/someJS.js'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.