- Issue created by @joachim
- π¬π§United Kingdom joachim
This works for getting the entity that's the current site:
$request = \Drupal::request(); $entities = \Drupal::entityTypeManager()->getStorage('environment_indicator')->loadByProperties([ 'url' => $request->getSchemeAndHttpHost(), ]); if ($entities) { $this->current = reset($entities); }
What needs to be worked out is how is should function -- should a entity be looked for only if there is no environment_indicator.indicator config?
- πΊπΈUnited States devkinetic
I've put work into this topic over on π Implement the current environment as a service and utilize plugins Active where current environment becomes a service and added a plugin manager to define the method of detecting the current environment. This way you can use whatever method you like, configure it, or even develop your own for more advanced scenarios. Unfortunately, it has not gotten any traction or feedback.