Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Delete.php
Go to the documentation of this file.
1 <?php
8 
10 
12 {
18  public function execute()
19  {
20  if ($this->_getUrlRewrite()->getId()) {
21  try {
22  $this->_getUrlRewrite()->delete();
23  $this->messageManager->addSuccess(__('You deleted the URL rewrite.'));
24  } catch (\Exception $e) {
25  $this->messageManager->addException($e, __('We can\'t delete URL Rewrite right now.'));
26  $this->_redirect('adminhtml/*/edit/', ['id' => $this->_getUrlRewrite()->getId()]);
27  return;
28  }
29  }
30  $this->_redirect('adminhtml/*/');
31  }
32 }
__()
Definition: __.php:13