Closed tito10047 closed 1 month ago
Add ability to modity InputProps inside EventListener
#[AsEventListener(priority: 100)] class UxIconListener { public function __invoke(PreCreateForRenderEvent $event): void { if ('ux:icon' !== strtolower($event->getName())) { return; } $attributes = $event->getInputProps(); if ($attributes['name']!=="my-global-icon"){ return; } $attributes["class"] = "icon view"; $attributes["title"]= "this item is public"; $event->setInputProps($attributes); } }
This event is not designed for this usage, but to return HTML and bypass the system.
You can achieve similar goal by:
Add ability to modity InputProps inside EventListener