Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR] Implement afterInitialize event in dispatching loop #782

Closed
iforp opened this issue Jul 4, 2013 · 2 comments
Closed

[NFR] Implement afterInitialize event in dispatching loop #782

iforp opened this issue Jul 4, 2013 · 2 comments

Comments

@iforp
Copy link
Contributor

iforp commented Jul 4, 2013

This issue is a continuation of this #703

For now events priority looks like this:

  • SomeListener::beforeExecuteRoute
  • Controller::beforeExecuteRoute
  • Controller::initialize
  • Controller::afterExecuteRoute

With ACL check now it's perfect: beforeExecuteRoute performs ACL check, so controller will not be initialized if user not authenticated.

In some cases we need to perform some operations after controller was initialized but before executing action.

My current case is parse CLI options to set controller params.

Of course I can call like this

    public function initialize()
    {
        // register all I need
        // ...

        $eventsManager->fire("dispatch:afterInitialize", $this, $extraData);
    }

but core implementation would be more usable

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ghost
Copy link

ghost commented Aug 4, 2013

@Agent-J could you please check if this works for you?

@Green-Cat
Copy link
Contributor

@andresgutierrez Implemented in #984. Also present in 2.0

if eventsManager->fire("dispatch:afterInitialize", this) === false {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants