Skip to content

Commit

Permalink
Callback on EVENT_BEFORE_REQUEST
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernst committed Mar 31, 2015
1 parent d2d784c commit 771631b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DeviceDetect.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function init() {
$this->_mobileDetect = new MobileDetect();
parent::init();

\Yii::$app->on(\yii\base\Application::EVENT_BEFORE_ACTION, function($event){
\Yii::$app->on(\yii\base\Application::EVENT_BEFORE_REQUEST, function($event){
\Yii::$app->params['devicedetect'] = [
'isMobile' => \Yii::$app->devicedetect->isMobile(),
'isTablet' => \Yii::$app->devicedetect->isTablet()
Expand Down

0 comments on commit 771631b

Please sign in to comment.