Development

Using the Messenger Service Instead of drupal_set_message in Drupal 8

As you may know, drupal_set_message()  is deprecated in Drupal 8.5.0.

Here’s a quick example of using dependency injection to use the new Messenger service:

mymodule.services.yml

src/MymoduleAuthentication.php

 

One Comment

Leave a Reply to Binny Thomas Cancel reply

Your email address will not be published.