Installing a redirect for a package

I’m developing a package that will require a page redirect under certain conditions. There are no blocks in the package, only dashboard views and controllers.

I’ve attempted to use Redirect::to() from the package controller on_start() method, but that is not working, I supposed because it’s called after headers have been added or it’s too late in the page rendering chain.

Could anyone tell me what they’ve done to implement a redirect from a custom package?

Rather than directly in the on start method, use the on_start method to set up an on_start event handler and try your redirect in that.

Thanks John, I’ll give this a try.

Just making sure, it’s not only a Redirect::to, the redirect must be sent, e.g.

$r = Redirect::to('/dashboard/forum');
$r->send();
exit;

@linuxoid yes, that is the correct method for a redirect in recent versions (maybe starting with v8.x) of Concrete.