getRequest()->getParam('id'); if ($id) { $design = $this->_objectManager->create('Magento\Framework\App\DesignInterface')->load($id); try { $design->delete(); $this->messageManager->addSuccess(__('You deleted the design change.')); } catch (\Magento\Framework\Exception\LocalizedException $e) { $this->messageManager->addError($e->getMessage()); } catch (\Exception $e) { $this->messageManager->addException($e, __("You can't delete the design change.")); } } /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); return $resultRedirect->setPath('adminhtml/*/'); } }