get current page at package on_start method

Permalink
Hi,
is it possible to get the current page at package on_start method? As i tested it always return null? is there any workaround?
public function on_start(){
    $c = Page::getCurrentPage();
    dd($c);
}

 
JohntheFish replied on at Permalink Reply
JohntheFish
Depending on the version of c5, the page may not be have been worked out at the time of the on_start method.

You can use on_start to set up an event handler for on_before_render, and the page will then be known.