pradosoft / prado

Prado - Component Framework for PHP
Other
187 stars 70 forks source link

Prado::createComponent accept multiple handlers for events (TWeakCallableCollection inserts array of handlers) #966

Closed belisoful closed 1 year ago

belisoful commented 1 year ago

Prado::createComponent can create components with events and attaches an event handler to the event, but it can only attach one handler for each event at initialization.

The Prado::createComponent should accept multiple event handlers in "setting events." To do this, TWeakCallableCollection needs to check if the inserting value is an array of handlers and loop through all the handlers and adding them each.