Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ListView.php
Go to the documentation of this file.
1 <?php
7 
15 {
20  protected $_forceHasOptions = false;
21 
27  public function getProductId()
28  {
29  $product = $this->_coreRegistry->registry('product');
30  return $product ? $product->getId() : null;
31  }
32 
38  protected function _prepareLayout()
39  {
40  parent::_prepareLayout();
41 
42  $toolbar = $this->getLayout()->getBlock('product_review_list.toolbar');
43  if ($toolbar) {
44  $toolbar->setCollection($this->getReviewsCollection());
45  $this->setChild('toolbar', $toolbar);
46  }
47 
48  return $this;
49  }
50 
56  protected function _beforeToHtml()
57  {
58  $this->getReviewsCollection()->load()->addRateVotes();
59  return parent::_beforeToHtml();
60  }
61 
68  public function getReviewUrl($id)
69  {
70  return $this->getUrl('*/*/view', ['id' => $id]);
71  }
72 }
$id
Definition: fieldset.phtml:14