File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 "yiisoft/error-handler" : " ^4.1" ,
5959 "yiisoft/html" : " ^3.11" ,
6060 "yiisoft/http" : " ^1.2" ,
61- "yiisoft/i18n" : " ^1.2.1" ,
6261 "yiisoft/injector" : " ^1.2" ,
6362 "yiisoft/log" : " ^2.1.1" ,
6463 "yiisoft/log-target-file" : " ^3.0" ,
Original file line number Diff line number Diff line change 88
99return [
1010 ApplicationParameters::class => [
11- 'class ' => ApplicationParameters::class,
12- 'charset() ' => [$ params ['app ' ]['charset ' ]],
13- 'name() ' => [$ params ['app ' ]['name ' ]],
11+ '__construct() ' => [
12+ 'name ' => $ params ['app ' ]['name ' ],
13+ 'charset ' => $ params ['app ' ]['charset ' ],
14+ 'locale ' => $ params ['app ' ]['locale ' ],
15+ ],
1416 ],
1517];
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 44
55use App \Asset \AppAsset ;
66use Yiisoft \Html \Html ;
7- use Yiisoft \I18n \Locale ;
87
98/**
109 * @var App\ApplicationParameters $applicationParameters
1110 * @var Yiisoft\Aliases\Aliases $aliases
1211 * @var Yiisoft\Assets\AssetManager $assetManager
1312 * @var string $content
1413 * @var string|null $csrf
15- * @var Locale $locale
1614 * @var Yiisoft\View\WebView $this
1715 * @var Yiisoft\Router\CurrentRoute $currentRoute
1816 * @var Yiisoft\Router\UrlGeneratorInterface $urlGenerator
2826
2927$ this ->beginPage ()
3028?> <!DOCTYPE html>
31- <html lang="<?= Html::encode ($ locale -> language () ) ?> ">
29+ <html lang="<?= Html::encode ($ applicationParameters -> locale ) ?> ">
3230<head>
33- <meta charset="<?= Html::encode ($ applicationParameters ->getCharset () ) ?> ">
31+ <meta charset="<?= Html::encode ($ applicationParameters ->charset ) ?> ">
3432 <meta http-equiv="X-UA-Compatible" content="IE=edge">
3533 <meta name="viewport" content="width=device-width, initial-scale=1">
3634 <title><?= Html::encode ($ this ->getTitle ()) ?> </title>
7775<div class="footer">
7876 <div class="footer_copyright">
7977 <a href="https://www.yiiframework.com/" target="_blank" rel="noopener">
80- © <?= date ('Y ' ) ?> <?= Html::encode ($ applicationParameters ->getName () ) ?>
78+ © <?= date ('Y ' ) ?> <?= Html::encode ($ applicationParameters ->name ) ?>
8179 </a>
8280 </div>
8381 <div class="footer_icons">
Original file line number Diff line number Diff line change 1212use Yiisoft \Translator \TranslatorInterface ;
1313use Yiisoft \View \WebView ;
1414
15- $ this ->setTitle ($ applicationParameters ->getName () );
15+ $ this ->setTitle ($ applicationParameters ->name );
1616?>
1717
1818<div class="text-center">
Original file line number Diff line number Diff line change 44
55namespace App ;
66
7- final class ApplicationParameters
7+ final readonly class ApplicationParameters
88{
9- private string $ charset = 'UTF-8 ' ;
10- private string $ name = 'My Project ' ;
11-
12- public function getCharset (): string
13- {
14- return $ this ->charset ;
15- }
16-
17- public function getName (): string
18- {
19- return $ this ->name ;
20- }
21-
22- public function charset (string $ value ): self
23- {
24- $ new = clone $ this ;
25- $ new ->charset = $ value ;
26- return $ new ;
27- }
28-
29- public function name (string $ value ): self
30- {
31- $ new = clone $ this ;
32- $ new ->name = $ value ;
33- return $ new ;
34- }
9+ public function __construct (
10+ public string $ name = 'My Project ' ,
11+ public string $ charset = 'UTF-8 ' ,
12+ public string $ locale = 'en ' ,
13+ ) {}
3514}
Original file line number Diff line number Diff line change 66
77use Yiisoft \Aliases \Aliases ;
88use Yiisoft \Assets \AssetManager ;
9- use Yiisoft \I18n \Locale ;
109use Yiisoft \Router \CurrentRoute ;
1110use Yiisoft \Yii \View \Renderer \LayoutParametersInjectionInterface ;
1211
1514 public function __construct (
1615 private Aliases $ aliases ,
1716 private AssetManager $ assetManager ,
18- private Locale $ locale ,
1917 private CurrentRoute $ currentRoute ,
2018 ) {}
2119
@@ -24,7 +22,6 @@ public function getLayoutParameters(): array
2422 return [
2523 'aliases ' => $ this ->aliases ,
2624 'assetManager ' => $ this ->assetManager ,
27- 'locale ' => $ this ->locale ,
2825 'currentRoute ' => $ this ->currentRoute ,
2926 ];
3027 }
You can’t perform that action at this time.
0 commit comments