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 7644293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:39:08+00:00 2026-05-31T09:39:08+00:00

The question is about the router’s setDispatched() method of Zend Framework… I have a

  • 0

The question is about the router’s setDispatched() method of Zend Framework…

I have a fooAction() and a loginAction() in the same controller (the indexController).

I also have an ActionHelper and I’m using it’s preDispatch() method. At the end of this function I have an if statement where I check the ACL:

public function preDispatch() {

    // some code...

    if (!$this->_acl->isAllowed($role, $resource, $privilege)) {
        $request->setModuleName('default');
        $request->setControllerName('index');
        $request->setActionName('login');

        $request->setDispatched(false); //what does this mean exactly??
    }
}

So when I want to reach fooAction(), and the user hasn’t got the permission, I set the Action name to ‘login’…

Now my question is: what does the $request->setDispatched(false); mean exactly?

Does it indicate that ZF can start to dispatch the loginAction() because it hasn’t been dispatched yet (setDispatched(false);)?

  • 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-31T09:39:09+00:00Added an answer on May 31, 2026 at 9:39 am

    From Zend Framework’s Reference Guide:

    At the beginning of each iteration, it sets a flag in the request
    object indicating that the action has been dispatched. If an action or
    pre or postDispatch plugin resets that flag, the dispatch loop will
    continue and attempt to dispatch the new request. By changing the
    controller and/or action in the request and resetting the dispatched
    flag, the developer may define a chain of requests to perform.

    By calling setDispatched(false) you’re basically saying that the request wasn’t sent to the controller yet, and the Dispatcher will attempt to re-despatch it. This is necessary because you’re changing the module, controller and action of the request and you want the Dispatcher to process it again and send it to the right place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good morning everyone, I have a question about J2EE framework. since ASP.net 3.5 mvc
I have some dilemma about controller usage. Like usualy, router (dispatcher or front controller)
Question about GridView sorting in VB.NET: I have a GridView with AutoGenerateColumns = True
I have a question about global.asax that I don't really understand. My scenario is
I have a question about the behaviour of my routes.rb . The following code
Have a question about the design/usage of asp.net mvc here. In the html helper
I am learning Ruby on Rails and I have a dumb question about the
I have a question about python and sockets. As I understand, if you have
I have a question about optimization, but more on the browser/client side. I am
I am a newcomer to RoR and have a question about routing. I have

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.