Hi all, I’ve just updated a site I’ve been working on to Kirby 4 and I am getting “Cannot modify header information” when I try to dump data in a route. Is there something simple I am missing? This was working before the update. Thanks!
'pattern' => 'resave-links/(:num?)',
'action' => function () use ($kirby) {
if (kirby()->user() && kirby()->user()->isAdmin()) {
dump(kirby()->user());
}
}
Yes, it seems to be fine as long as I don’t output anything. I created a new route to test with and echo instead of dump() and I get the same result.
[
'pattern' => 'test-route',
'action' => function () {
if (kirby()->user() && kirby()->user()->isAdmin()) {
echo "Something";
}
}
],
Sorry to hassle you further @texnixe but I just wanted to check if I’m understanding that correctly. Do you know if the error is showing because I am not using return to output instead of just outputting it?