Just PRd a proof of conceptIf anyone wants to have a way to sort template events, it can be implemented easily. It's more about "do admins need to have that power"?
Based on discord.. Toxyy was/is working on that sorting part.

https://github.com/phpbb/phpbb/pull/6571
If approved, you could add priority to template events by hooking into the
twig_tokenparser_constructor
(name of event TBD) event in a listener.Example event usage:
Code:
public function twig_tokenparser_constructor($event){$template_event_priority_array = $event['template_event_priority_array'];$template_event_priority_array += ['toxyy_postformtemplates' => ['event/overall_header_head_append' => 1000]];$event['template_event_priority_array'] = $template_event_priority_array;}
With this, my template event is called before any others. Normal behavior would have it placed on the bottom of this list.
As stated in the commit message, priority works like in Symfony events, the higher number will be compiled first.
If two events have the same priority, then the last one added will be executed last - this differs from what's stated in my initial commit message, sorry about that, I was thinking about it wrong.
Reason being is that for an array:
Code:
[ '0' => 'first_event', '1' => 'second_event', '2' => 'third_event', '3' => 'fourth_event']
Code:
[ '0' => 'first_event', '1' => 'second_event', '2' => 'priority_set_event', '3' => 'third_event', '4' => 'fourth_event']
Code:
[ '0' => 'first_event', '1' => 'second_event', '2' => 'another_priority_set_event', '3' => 'priority_set_event'. '4' => 'third_event', '5' => 'fourth_event']
Statistics: Posted by Toxyy — Sun Dec 03, 2023 10:10 pm