|
6 | 6 | msgid "" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | | -"POT-Creation-Date: 2025-12-24 13:00+0000\n" |
| 9 | +"POT-Creation-Date: 2025-12-25 15:54+0000\n" |
10 | 10 | "PO-Revision-Date: 2025-12-24 08:02+0000\n" |
11 | 11 | "Last-Translator: Automatically generated\n" |
12 | 12 | "Language-Team: none\n" |
@@ -44,36 +44,6 @@ msgid "" |
44 | 44 | "<p>The message is: <?= Html::encode($message) ?></p>\n" |
45 | 45 | msgstr "" |
46 | 46 |
|
47 | | -#. type: Fenced code block (php) |
48 | | -#: ../src/guide/start/hello.md ../src/guide/views/view.md |
49 | | -#, no-wrap |
50 | | -msgid "" |
51 | | -"<?php\n" |
52 | | -"\n" |
53 | | -"declare(strict_types=1);\n" |
54 | | -"\n" |
55 | | -"namespace App\\Web\\Echo;\n" |
56 | | -"\n" |
57 | | -"use Psr\\Http\\Message\\ResponseInterface;\n" |
58 | | -"use Yiisoft\\Router\\HydratorAttribute\\RouteArgument;\n" |
59 | | -"use Yiisoft\\Yii\\View\\Renderer\\ViewRenderer;\n" |
60 | | -"\n" |
61 | | -"final readonly class Action\n" |
62 | | -"{\n" |
63 | | -" public function __construct(\n" |
64 | | -" private ViewRenderer $viewRenderer,\n" |
65 | | -" ) {}\n" |
66 | | -"\n" |
67 | | -" #[RouteArgument('message')]\n" |
68 | | -" public function __invoke(string $message = 'Hello!'): ResponseInterface\n" |
69 | | -" {\n" |
70 | | -" return $this->viewRenderer->render(__DIR__ . '/template', [\n" |
71 | | -" 'message' => $message,\n" |
72 | | -" ]);\n" |
73 | | -" }\n" |
74 | | -"}\n" |
75 | | -msgstr "" |
76 | | - |
77 | 47 | #. type: Title ## |
78 | 48 | #: ../src/guide/views/asset.md ../src/guide/views/view.md |
79 | 49 | #: ../src/guide/views/widget.md |
@@ -139,6 +109,35 @@ msgstr "" |
139 | 109 | msgid "Here `$message` is a view data that is passed when you render a template with the help of `ViewRenderer`. For example, `src/Web/Echo/Action.php`:" |
140 | 110 | msgstr "" |
141 | 111 |
|
| 112 | +#. type: Fenced code block (php) |
| 113 | +#: ../src/guide/views/view.md |
| 114 | +#, no-wrap |
| 115 | +msgid "" |
| 116 | +"<?php\n" |
| 117 | +"\n" |
| 118 | +"declare(strict_types=1);\n" |
| 119 | +"\n" |
| 120 | +"namespace App\\Web\\Echo;\n" |
| 121 | +"\n" |
| 122 | +"use Psr\\Http\\Message\\ResponseInterface;\n" |
| 123 | +"use Yiisoft\\Router\\HydratorAttribute\\RouteArgument;\n" |
| 124 | +"use Yiisoft\\Yii\\View\\Renderer\\ViewRenderer;\n" |
| 125 | +"\n" |
| 126 | +"final readonly class Action\n" |
| 127 | +"{\n" |
| 128 | +" public function __construct(\n" |
| 129 | +" private ViewRenderer $viewRenderer,\n" |
| 130 | +" ) {}\n" |
| 131 | +"\n" |
| 132 | +" public function __invoke(string $message = 'Hello!'): ResponseInterface\n" |
| 133 | +" {\n" |
| 134 | +" return $this->viewRenderer->render(__DIR__ . '/template', [\n" |
| 135 | +" 'message' => $message,\n" |
| 136 | +" ]);\n" |
| 137 | +" }\n" |
| 138 | +"}\n" |
| 139 | +msgstr "" |
| 140 | + |
142 | 141 | #. type: Plain text |
143 | 142 | #: ../src/guide/views/view.md |
144 | 143 | msgid "First argument of the `render()` method is a path to the template file. In the `yiisoft/app`, template files are typically stored alongside their actions. The result is ready to be rendered to the browser so we return it immediately." |
|
0 commit comments