init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\Review\Plugin\Adminhtml\Review;
|
||||
|
||||
use Esun\Review\Block\Adminhtml\Review\Images;
|
||||
use Magento\Review\Block\Adminhtml\Edit\Form;
|
||||
|
||||
class FormImagesPlugin
|
||||
{
|
||||
public function afterToHtml(Form $subject, string $html): string
|
||||
{
|
||||
$reviewId = (int)$subject->getRequest()->getParam('id');
|
||||
if ($reviewId <= 0) {
|
||||
return $html;
|
||||
}
|
||||
|
||||
$imagesHtml = $subject->getLayout()
|
||||
->createBlock(Images::class)
|
||||
->setTemplate('Esun_Review::review/images.phtml')
|
||||
->setData('review_id', $reviewId)
|
||||
->toHtml();
|
||||
|
||||
return $imagesHtml ? $html . $imagesHtml : $html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user