Skip to content

Commit

Permalink
Add View class config
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Feb 22, 2021
1 parent 17daf07 commit 9ea05f9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
},
"config-plugin": {
"params": "config/params.php",
"common": "config/common.php",
"console": "config/console.php",
"web": "config/web.php"
}
Expand Down
20 changes: 20 additions & 0 deletions config/common.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use Yiisoft\Aliases\Aliases;
use Yiisoft\View\View;

/** @var array $params */

return [
View::class => [
'__class' => View::class,
'__construct()' => [
'basePath' => static fn (Aliases $aliases) => $aliases->get($params['yiisoft/view']['basePath']),
],
'setDefaultParameters()' => [
$params['yiisoft/view']['defaultParameters'],
],
],
];

0 comments on commit 9ea05f9

Please sign in to comment.