Skip to content

All args not being passed to event handler function #14

@evtaylor

Description

@evtaylor

Bug only appears to happen when adding listener to event that has more than one arg. Example 'baun.beforePageRender'.

Baun emits event like this:

$this->events->emit('baun.beforePostRender', $template, $data);

But Baun events provider emit function only accepts 2 arguments:

public function emit($event, $args = [])
{
    $this->emitter->emit($event, $args);
}

Therefore $template gets passed through and $data does not.

This could be fixed by emitting events with multiple args in an array:

$this->events->emit('baun.beforePageRender', [$template, $data]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions