User tests: Successful: Unsuccessful:
With the introduction of service providers and the DI container, class overrides should be avoided in extensions. This pr adds the container to the onBeforeExecute
plugin event. Like that an extension developer can override the services in the container.
The following code example registers it's own form factory:
public function onBeforeExecute(BeforeExecuteEvent $event)
{
$event->getContainer()->share(
FormFactoryInterface::class,
function (Container $container)
{
return new MyAwesomeFormFactory;
},
true
);
}
NOTE:
Not sure if a new event should be created for that, was lazy and did use an existing one.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-04-07 16:36:37 |
Closed_By | ⇒ | wilsonge |
Should be fine. As long as the CMS keeps using the
onWhatever
naming convention then it's clear these are "CMS owned" events. Now if we ever moved to use the events defined in the base Framework classes after joomla-framework/application#76 then we'd want to re-think the event arguments/naming IMO.