We are using a custom variable initalized like this in our module:
Event::on(CraftVariable::class, CraftVariable::EVENT_INIT,
function (Event $event) {
/** @var CraftVariable $variable */
$variable = $event->sender;
$variable->set('myvar', MyVar::class);
}
);
The variable can be access from TWIG via
{{ craft.myvar.WHATEVER }}
But how can I access it from PHP, e.g. from an adjuster or another controller?