|
6 | 6 | msgid "" |
7 | 7 | msgstr "" |
8 | 8 | "Project-Id-Version: PACKAGE VERSION\n" |
9 | | -"POT-Creation-Date: 2025-12-25 21:55+0000\n" |
| 9 | +"POT-Creation-Date: 2025-12-26 18:18+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,6 +44,38 @@ 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 | +" public function __invoke(\n" |
| 68 | +" #[RouteArgument('message')]\n" |
| 69 | +" string $message = 'Hello!'\n" |
| 70 | +" ): ResponseInterface\n" |
| 71 | +" {\n" |
| 72 | +" return $this->viewRenderer->render(__DIR__ . '/template', [\n" |
| 73 | +" 'message' => $message,\n" |
| 74 | +" ]);\n" |
| 75 | +" }\n" |
| 76 | +"}\n" |
| 77 | +msgstr "" |
| 78 | + |
47 | 79 | #. type: Title ## |
48 | 80 | #: ../src/guide/views/asset.md ../src/guide/views/view.md |
49 | 81 | #: ../src/guide/views/widget.md |
@@ -109,36 +141,6 @@ msgstr "" |
109 | 141 | 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`:" |
110 | 142 | msgstr "" |
111 | 143 |
|
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 | | -" #[RouteArgument('message')]\n" |
133 | | -" public function __invoke(string $message = 'Hello!'): ResponseInterface\n" |
134 | | -" {\n" |
135 | | -" return $this->viewRenderer->render(__DIR__ . '/template', [\n" |
136 | | -" 'message' => $message,\n" |
137 | | -" ]);\n" |
138 | | -" }\n" |
139 | | -"}\n" |
140 | | -msgstr "" |
141 | | - |
142 | 144 | #. type: Plain text |
143 | 145 | #: ../src/guide/views/view.md |
144 | 146 | 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