Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RatingItems.php
Go to the documentation of this file.
1 <?php
7 
9 use Magento\Framework\App\Action\HttpPostActionInterface as HttpPostActionInterface;
13 use Magento\Review\Model\ReviewFactory;
14 use Magento\Review\Model\RatingFactory;
17 
18 class RatingItems extends ProductController implements HttpPostActionInterface, HttpGetActionInterface
19 {
23  protected $layoutFactory;
24 
32  public function __construct(
33  Context $context,
35  ReviewFactory $reviewFactory,
36  RatingFactory $ratingFactory,
38  ) {
39  $this->layoutFactory = $layoutFactory;
40  parent::__construct($context, $coreRegistry, $reviewFactory, $ratingFactory);
41  }
42 
46  public function execute()
47  {
48  $layout = $this->layoutFactory->create();
50  $resultRaw = $this->resultFactory->create(ResultFactory::TYPE_RAW);
51  $resultRaw->setContents(
52  $layout->createBlock(\Magento\Review\Block\Adminhtml\Rating\Detailed::class)
53  ->setIndependentMode()
54  ->toHtml()
55  );
56  return $resultRaw;
57  }
58 }
__construct(Context $context, Registry $coreRegistry, ReviewFactory $reviewFactory, RatingFactory $ratingFactory, LayoutFactory $layoutFactory)
Definition: RatingItems.php:32