Closed kylekatarnls closed 6 years ago
Right now, an event listener option can pass only one event callback and if an extension use it, it erase previous callback possibly put by an other extension.
Tasks:
... 'on_format' => [$callback1, $callback2, $callback3], ...
class Extension1 extends \Phug\AbstractExtension { public function getEvents() { return [ 'on_format' => [$c1, $c2], 'on_parse' => $c3, ]; } } class Extension2 extends \Phug\AbstractExtension { public function getEvents() { return [ 'on_format' => $c4, 'on_output' => [$c5], ]; } } Phug::addExtension(Extension1::class); Phug::addExtension(Extension2::class);
Phug::getOptions() should then contains:
Phug::getOptions()
[ 'on_format' => [$c1, $c2, $c4], 'on_parse' => [$c3], 'on_output' => [$c5], ]
https://phug-lang.com/#events
Available in 0.3.2
Right now, an event listener option can pass only one event callback and if an extension use it, it erase previous callback possibly put by an other extension.
Tasks:
Allow array (multiple callbacks) arguments for all event options.
Merge events from extensions into an array
Phug::getOptions()
should then contains:Documents new event option feature
https://phug-lang.com/#events