Skip to content

Commit

Permalink
Update controller and params configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Dec 8, 2023
1 parent 58ddecc commit 1de365b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
23 changes: 5 additions & 18 deletions config/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
'@yii-user/mailer' => '@yii-user/src/Framework/resource/mailer',
'@yii-user/migration' => '@yii-user/src/Framework/Migration',
],
'app.controllerMap' => [
'console.aliases' => [
'@yii-user' => '@vendor/yii2-extensions/user',
'@yii-user/migration' => '@yii-user/src/Framework/Migration',
],
'web.controllerMap' => [
'login' => [
'class' => LoginController::class,
],
Expand All @@ -23,21 +27,4 @@
'class' => RegisterController::class,
],
],
'app.params' => [
'app.menu.islogged' => [
[
'label' => 'Logout',
'url' => ['/logout/index'],
'order' => 1,
'category' => 'yii.user',
'linkOptions' => [
'data-method' => 'post',
],
],
],
],
'console.aliases' => [
'@yii-user' => '@vendor/yii2-extensions/user',
'@yii-user/migration' => '@yii-user/src/Framework/Migration',
],
];
15 changes: 13 additions & 2 deletions config/tests/params-web.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
use App\UseCase\Site\SiteController;

return [
'app.controllerMap' => [
'web.controllerMap' => [
'site' => [
'class' => SiteController::class,
],
],
'app.params' => [
'web.params' => [
'app.menu.isguest' => [
[
'label' => 'Register',
Expand All @@ -25,6 +25,17 @@
'category' => 'yii.user',
],
],
'app.menu.islogged' => [
[
'label' => 'Logout',
'url' => ['/logout/index'],
'order' => 1,
'category' => 'yii.user',
'linkOptions' => [
'data-method' => 'post',
],
],
],
'icons' => '@npm/fortawesome--fontawesome-free/svgs/{family}/{name}.svg',
],
];
4 changes: 2 additions & 2 deletions config/tests/web/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
],
'basePath' => dirname(__DIR__, 3),
'bootstrap' => ['log'],
'controllerMap' => $params['app.controllerMap'],
'controllerMap' => $params['web.controllerMap'],
'id' => 'app-tests',
'language' => 'en-US',
'name' => 'Web application basic',
'on beforeAction' => static function (): void {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
},
'params' => $params['app.params'] ?? [],
'params' => $params['web.params'] ?? [],
'runtimePath' => dirname(__DIR__, 3) . '/tests/public/runtime',
];
3 changes: 0 additions & 3 deletions config/web/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

use yii\symfonymailer\Mailer;
use Yii\User\ActiveRecord\Identity;
use Yii\User\Framework\Repository\PersistenceRepository;
use Yii\User\Framework\Repository\PersistenceRepositoryInterface;
use yii\web\User;

return [
Expand All @@ -14,7 +12,6 @@
Mailer::class => [
'useFileTransport' => true,
],
PersistenceRepositoryInterface::class => PersistenceRepository::class,
User::class => [
'identityClass' => Identity::class,
'loginUrl' => ['/login/index'],
Expand Down

0 comments on commit 1de365b

Please sign in to comment.