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?
kint()
? 2. Better useksm()
as it prints the variables in the messages container which by default should be placed at the top of the content area.