Skip to content

Commit aac1397

Browse files
Merge pull request #86 from DeryabinSergey/main
Added information about passing variables in Widget template. Changed…
2 parents 90c6686 + e2d46c4 commit aac1397

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/tutorials/frontend/create-custom-widget.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,14 @@ And finally, create the template that will be used for showing the widget's data
153153
154154
```php
155155
<?php
156-
/** \ExampleCorp\Learning\Block\Widget\Test $block */
156+
/** @var \Magento\Framework\View\TemplateEngineInterface $this */
157+
/** @var \ExampleCorp\Learning\Block\Widget\Test $block */
158+
/** @var \Magento\Csp\Api\InlineUtilInterface $csp */
159+
/** @var \Magento\Framework\Escaper $escaper */
160+
/** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
157161
?>
158-
<h3><?= $block->escapeHtml($block->getData('title')) ?></h3>
159-
<h3><?= $block->escapeHtml(__('Size:')) ?> <?= $block->escapeHtml($block->getData('size')) ?></h3>
162+
<h3><?= $escaper->escapeHtml($block->getData('title')) ?></h3>
163+
<h3><?= $escaper->escapeHtml(__('Size:')) ?> <?= $escaper->escapeHtml($block->getData('size')) ?></h3>
160164
```
161165

162166
### Step 6. Clean Cache

0 commit comments

Comments
 (0)