Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
recent.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
10 ?>
11 <?php if ($block->getReviews() && count($block->getReviews())): ?>
12 <div class="block block-reviews-dashboard">
13  <div class="block-title">
14  <strong><?= $block->escapeHtml(__('My Recent Reviews')) ?></strong>
15  <a class="action view" href="<?= $block->escapeUrl($block->getAllReviewsUrl()) ?>"><span><?= $block->escapeHtml(__('View All')) ?></span></a>
16  </div>
17  <div class="block-content">
18  <ol class="items">
19  <?php foreach ($block->getReviews() as $_review): ?>
20  <li class="item">
21  <strong class="product-name"><a href="<?= $block->escapeUrl($block->getReviewUrl($_review->getReviewId())) ?>"><?= $block->escapeHtml($_review->getName()) ?></a></strong>
22  <?php if ($_review->getSum()): ?>
23  <?php $rating = $_review->getSum() / $_review->getCount() ?>
24  <div class="rating-summary">
25  <span class="label"><span><?= $block->escapeHtml(__('Rating')) ?>:</span></span>
26  <div class="rating-result" title="<?= $block->escapeHtmlAttr($rating) ?>%">
27  <span style="width:<?= $block->escapeHtmlAttr($rating) ?>%"><span><?= $block->escapeHtml($rating) ?>%</span></span>
28  </div>
29  </div>
30  <?php endif; ?>
31  </li>
32  <?php endforeach; ?>
33  </ol>
34  </div>
35 </div>
36 <?php endif; ?>
__()
Definition: __.php:13
$rating
Definition: item.phtml:18
$block
Definition: block.php:8
endif
Definition: recent.phtml:36
endforeach
Definition: recent.phtml:32