Jump to content

let a hook disable other hooks


---
 Share

Recommended Posts

So I discovered in this topic (

) that I can cancel all hooks after my own hook. Now I want something like that.

 

I want my hook which is called on page render to cancel all other events, also the after page render and the before page render methods, is this possible?

This only need to be done when some conditions are met.

 

/** method replaces original page::render method and is called with hook priority one */
method onPageRender (HookEvent $event)
{
    if (my condition is true) {
        $this->cancelHooks = true; // to cancel all hooks to page::render
        // how to cancel after Page::render events
        // how to cancel before Page::render events
    }
}

Is this possible at all?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...