From 7e61c883a3f3dc55cceb38886efae7458c50c50d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20H=C3=A4rtl?= Date: Tue, 10 Apr 2018 11:20:31 +0200 Subject: [PATCH] Issue #23 Fix docs for $event->sender --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1a4b2bb..dc78565 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,8 @@ Property | Description Event | Description ---------|------------- -`beforeRender` | Triggered before the sheet is rendered. The sheet is available via `$event->source->getSheet()`. -`afterRender` | Triggered after the sheet was rendered. The sheet is available via `$event->source->getSheet()`. +`beforeRender` | Triggered before the sheet is rendered. The sheet is available via `$event->sender->getSheet()`. +`afterRender` | Triggered after the sheet was rendered. The sheet is available via `$event->sender->getSheet()`. ### ActiveExcelSheet @@ -302,7 +302,7 @@ $file = \Yii::createObject([ ### Events -Since version 2.3.5 there are new events which make it easier to further modify each sheet. +Since version 2.5.0 there are new events which make it easier to further modify each sheet. ```php User::find(), 'startRow' => 3, 'on beforeRender' => function ($event) { - $sheet = $event->source->getSheet(); + $sheet = $event->sender->getSheet(); $sheet->setCellValue('A1', 'List of current users'); } ],