Skip to content

Commit

Permalink
Add $block @var hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
jellesiderius committed Aug 23, 2023
1 parent 16b250f commit cef4bf4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions layouts-blocks-and-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ method using the `$block` object.

```php
<?php
/** @var \Vendor\Module\Block\RecentProducts $block */

$recentProducts = $block->getRecentProducts();

Expand All @@ -129,6 +130,10 @@ create a template file named `recent_products.phtml` within your theme's templat
write the necessary HTML and PHP code to render the list.

```html+php
<?php
/** @var \Vendor\Module\Block\RecentProducts $block */
$recentProducts = $block->getRecentProducts();
?>
<div class="recent-products">
<h2>Recently Added Products</h2>
<ul>
Expand Down

0 comments on commit cef4bf4

Please sign in to comment.