I’ve been meaning to ask this for a while. If a plugin is only tied to a single event, is there any reason for code like the following:
$e = &$modx->Event;
switch($e->name) {
case: 'OnSomething';
//do something;
break;
default:
//do something else;
}
I see it in a lot of plugins (sometimes as an ’if’ statement instead), but it seems it would only be necessary if MODx’s event routing were unreliable or if the plugin were tied to more than one event.