1
1
<?php
2
2
/**
3
- * Copyright © 2015 Ihor Vansach ([email protected] ). All rights reserved.
3
+ * Copyright © 2015-2017 Ihor Vansach ([email protected] ). All rights reserved.
4
4
* See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).
5
5
*
6
6
* Glory to Ukraine! Glory to the heroes!
@@ -26,16 +26,16 @@ class Comments extends \Magento\Framework\View\Element\Template
26
26
protected $ _coreRegistry ;
27
27
28
28
/**
29
- * Construct
30
- *
31
- * @param \Magento\Framework\View\Element\Context $context
32
- * @param \Magento\Framework\Registry $coreRegistry,
33
- * @param \Magento\Cms\Model\Page $post
34
- * @param \Magento\Framework\Registry $coreRegistry,
35
- * @param \Magento\Cms\Model\ Template\FilterProvider $filterProvider
36
- * @param \Magento\Store\Model\StoreManagerInterface $storeManager
37
- * @param \Magento\Cms\Model\PageFactory $postFactory
38
- * @param array $data
29
+ * @var string
30
+ */
31
+ protected $ commetType ;
32
+
33
+ /**
34
+ * Constructor
35
+ * @param \Magento\Framework\View\Element\ Template\Context $context
36
+ * @param \Magento\Framework\Registry $coreRegistry
37
+ * @param \Magento\Framework\Locale\ResolverInterface $localeResolver
38
+ * @param array $data
39
39
*/
40
40
public function __construct (
41
41
\Magento \Framework \View \Element \Template \Context $ context ,
@@ -121,4 +121,18 @@ public function getPost()
121
121
}
122
122
return $ this ->getData ('post ' );
123
123
}
124
+
125
+ /**
126
+ * Render block HTML
127
+ *
128
+ * @return string
129
+ */
130
+ protected function _toHtml ()
131
+ {
132
+ if ($ this ->commetType && $ this ->commetType != $ this ->getCommentsType ()) {
133
+ return '' ;
134
+ }
135
+
136
+ return parent ::_toHtml ();
137
+ }
124
138
}
0 commit comments