<?php


namespace Magetop\Advancepreview\Controller\Adminhtml\PreviewAdditionalTab;


class Items extends \Magetop\Advancepreview\Controller\Adminhtml\PreviewAdditionalTab
{
    public function execute()
    {
        $response = [
            'status'=>'error',
            'html'=>'',
            'message'=>'Can not get data'
        ];
        try {
            $response['html'] = $this->_view->getLayout()->createBlock('Magetop\Advancepreview\Block\Adminhtml\Product\Edit\PreviewAdditionalTab')->setTemplate('Magetop_Advancepreview::product/addition_tab/items.phtml')->toHtml();
            $response['status'] = 'success';
            $response['message'] = __('Get Item success');
        }
        catch (\Exception $exception) {
            $response['message'] = $exception->getMessage();
        }
        return $this->getAjaxResponse($response);
    }
}
