Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Problem about Controller_{event}_Handler

helloroyhelloroy New
edited August 2012 in Vanilla 2.0 - 2.8

Hi All,

I added an event {event name="BeginBody"} in default.master.tpl and want to fire it for every page, but many controller I need to add, for example:

public function DiscussionsController_BeginBody_Handler($Sender) {
}

public function DiscussionController_BeginBody_Handler($Sender) {
}

public function CategoriesController_BeginBody_Handler($Sender) {
}

My question is how to apply handler to all controller more easily? something like this?

public function AllController_BeginBody_Handler($Sender) {
}

Thanks ~ :)

Best Answer

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    The word you want is Base.

    public function Base_BeginBody_Handler($Sender) {
    ...
    }
    

Answers

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    Answer ✓

    The word you want is Base.

    public function Base_BeginBody_Handler($Sender) {
    ...
    }
    
Sign In or Register to comment.