<?php


namespace Magetop\Advancepreview\Controller\Adminhtml\ProductPreview;


class Edit extends \Magetop\Advancepreview\Controller\Adminhtml\ProductPreview
{
    public function execute()
    {
        $response = [
            'status'=>'error',
            'html'=>''
        ];
        try {
            $response['html'] = $this->_view->getLayout()->createBlock('Magetop\Advancepreview\Block\Adminhtml\Product\Edit\Form')->setTemplate('Magetop_Advancepreview::product/edit.phtml')->toHtml();
            $response['status'] = 'success';
        }
        catch (\Exception $exception) {
            $response['html'] = $exception->getMessage();
        }
        return $this->getAjaxResponse($response);
    }
}
