basePresenter run code before other presenters are called
Notice: This thread is very old.
- simonjcarr
- Member | 28
I want to put some code in my basePresenter that runs at every page request, how do I do it?
- simonjcarr
- Member | 28
@CZechBoY Thanks for the response. I have the following code in my BasePresenter.php file. But nothing happens. I would expect a white screen with just “I am here”.
Any idea what I might be doing wrong?
namespace App\Presenters;
use Nette;
use App\Model;
/**
* Base presenter for all application presenters.
*/
abstract class BasePresenter extends Nette\Application\UI\Presenter {
protected function startup() {
parent::startup();
echo "I am here";
exit;
}
}
- simonjcarr
- Member | 28
@JanEndel Thanks. That was the issue, I was not extending BasePresenter
It works now.
Thanks