yii2 how to check is url code example Example: yii current url // Yii 1 Yii::app()->request->url // Yii 2 Yii::$app->request->url