|
|
|
|
|
|
|
|
|
|
|
|
|
|
return [ |
|
|
return [ |
|
|
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', |
|
|
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', |
|
|
|
|
|
'on beforeRequest' => function () { |
|
|
|
|
|
$app = Yii::$app; |
|
|
|
|
|
$pathInfo = $app->request->pathInfo; |
|
|
|
|
|
if (!empty($pathInfo) && substr($pathInfo, -1) == '/') { |
|
|
|
|
|
$url = Yii::$app->request->getAbsoluteUrl(); |
|
|
|
|
|
$url = substr($url, 0, strlen($url) - 1); |
|
|
|
|
|
Yii::$app->getResponse()->redirect($url, 301); |
|
|
|
|
|
Yii::$app->end(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
'components' => [ |
|
|
'components' => [ |
|
|
'user' => [ |
|
|
'user' => [ |
|
|
'class' => 'yii\web\User', |
|
|
'class' => 'yii\web\User', |