4

Make sure you inject config.factory and then you need to use: $this->config ->get('my_custom_module.settings') ->get('display_debugging_info'); You can see that Drupal::config() is: public static function config($name) { return static::getContainer() ->get('config.factory') ->get($name); } So after injecting your service, the ...


1

hook_ENTITY_TYPE_view() is probably the most misunderstood/misused hook in Drupal 8, mainly because it behaves differently than it did in Drupal 7 so you will find many misleading examples which no longer work in the current version of Drupal. In short, hook_ENTITY_TYPE_view() is only called when the entity is being rendered - after the entity has been ...


Only top voted, non community-wiki answers of a minimum length are eligible