EVENT_BEGIN_BODY − triggered in layouts by the call of yii\web\View::beginBody().
EVENT_END_BODY − triggered in layouts by the call of yii\web\View::endBody().
EVENT_BEGIN_PAGE − triggered in layouts by the call of yii\web\View::beginPage().
EVENT_END_PAGE − triggered in layouts by the call of yii\web\View::endPage().
EVENT_BEFORE_RENDER − triggered in a controller at the beginning of rendering a file.
EVENT_AFTER_RENDER − triggered after rendering a file
public function actionAbout() {
\Yii::$app->view->on(View::EVENT_BEGIN_BODY, function () {
echo date('m.d.Y H:i:s');
});
return $this->render('about');
}