How to show kint debug info from a module on a page? In D8 I would like to display an array in the message part of a page. I did several things but could not get it work. What to do?

I installed the devel and kint modules. 

I currently have changed  in services.yml the settings into:

debug: true   
auto_reload: true   
cache: false


In the twig template I added 

{{kint("I'm working from the page.html.twig")}}


This is displayed in the browser, so the current theme is displaying it which proves kint is working and the correct theme is used.

So now In my module file I have

$data_array = json_decode($data,true);
kint($data_array);
var_dump($data_array);
return $data_array;


The var_dump gives a lot of data in a array. However the kint is not displayed.

How to get the kint displayed this array?
Try to take a look at this site it has a lot if useful information, print variables using kint.

They say that if you want to output in the message area then you shall use, ksm().