In a conversation about modifying built-in services, @bencroker noted that we don't mention yii\base\Component::attachBehavior() as an alternative to the event-based approach.
Most classes in Craft ultimately inherit from this (including our core services), so it's possible to augment them without going via an intermediate event listener:
Product
Craft CMS
Description
In a conversation about modifying built-in services, @bencroker noted that we don't mention
yii\base\Component::attachBehavior()
as an alternative to the event-based approach.Most classes in Craft ultimately inherit from this (including our core services), so it's possible to augment them without going via an intermediate event listener:
This bears some similarities to our discussion of instance-level events.