We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This problem appears with version 2.0.45. On version 2.0.44 or below it works as expected.
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ new GroupUrlRule([ 'prefix' => '/', 'routePrefix' => 'test', 'rules' => [ '/' => 'default/index', ], ]), ], ],
php -S localhost:8888
Result from running route test/default/index
Result from running route site/index
When downgrading Yii to 2.0.44 it loads test/default/index correctly.
config/web.php
<?php use yii\web\GroupUrlRule; $params = require __DIR__ . '/params.php'; $db = require __DIR__ . '/db.php'; $config = [ 'id' => 'basic', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'aliases' => [ '@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset', ], 'modules' => [ 'test' => 'app\modules\test\Module', ], 'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation 'cookieValidationKey' => 'abs', ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'user' => [ 'identityClass' => 'app\models\User', 'enableAutoLogin' => true, ], 'errorHandler' => [ 'errorAction' => 'site/error', ], 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', // send all mails to a file by default. You have to set // 'useFileTransport' to false and configure transport // for the mailer to send real emails. 'useFileTransport' => true, ], 'log' => [ 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], ], ], ], 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ new GroupUrlRule([ 'prefix' => '/', 'routePrefix' => 'test', 'rules' => [ '/' => 'default/index', ], ]), ], ], 'db' => $db, /* 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ], ], */ ], 'params' => $params, ]; if (YII_ENV_DEV) { // configuration adjustments for 'dev' environment $config['bootstrap'][] = 'debug'; $config['modules']['debug'] = [ 'class' => 'yii\debug\Module', // uncomment the following to add your IP if you are not connecting from localhost. //'allowedIPs' => ['127.0.0.1', '::1'], ]; $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = [ 'class' => 'yii\gii\Module', // uncomment the following to add your IP if you are not connecting from localhost. //'allowedIPs' => ['127.0.0.1', '::1'], ]; } return $config;
Module test setup modules/tests/controllers/DefaultController.php
<?php namespace app\modules\test\controllers; class DefaultController extends \yii\web\Controller { public function actionIndex() { return $this->render('index'); } }
modules/tests/views/default/index.php
index <?php
modules/test/Module.php
<?php namespace app\modules\test; class Module extends \yii\base\Module { }
The text was updated successfully, but these errors were encountered:
I don't see error, http://localhost:8888/ - Application::$defaultRoute, http://localhost:8888/test/ - DefaultController(test module)
http://localhost:8888/
Application::$defaultRoute
http://localhost:8888/test/
DefaultController
test
Sorry, something went wrong.
Hm, I can see this change made to the GroupUrlRule. Was there a reason to remove /?
GroupUrlRule
/
I can confirm that changing that line back solves the issue.
No branches or pull requests
What steps will reproduce the problem?
This problem appears with version 2.0.45. On version 2.0.44 or below it works as expected.
php -S localhost:8888
What is the expected result?
Result from running route test/default/index
What do you get instead?
Result from running route site/index
When downgrading Yii to 2.0.44 it loads test/default/index correctly.
Additional info
config/web.php
Module test setup
modules/tests/controllers/DefaultController.php
modules/tests/views/default/index.php
modules/test/Module.php
The text was updated successfully, but these errors were encountered: