Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-variable
Controller
Adminhtml
System
Variable
Delete.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Variable\Controller\Adminhtml\System\Variable
;
8
9
class
Delete
extends
\Magento\Variable\Controller\Adminhtml\System\Variable
10
{
16
public
function
execute
()
17
{
18
$variable
= $this->
_initVariable
();
20
$resultRedirect = $this->resultRedirectFactory->create();
21
if
(
$variable
->getId()) {
22
try
{
23
$variable
->delete();
24
$this->messageManager->addSuccess(
__
(
'You deleted the custom variable.'
));
25
}
catch
(\Exception $e) {
26
$this->messageManager->addError($e->getMessage());
27
return
$resultRedirect->setPath(
'adminhtml/*/edit'
, [
'_current'
=>
true
]);
28
}
29
}
30
return
$resultRedirect->setPath(
'adminhtml/*/'
);
31
}
32
}
Magento\Variable\Controller\Adminhtml\System\Variable\_initVariable
_initVariable()
Definition:
Variable.php:92
__
__()
Definition:
__.php:13
$variable
$variable
Definition:
variable.php:7
Magento\Framework\App\ActionInterface\execute
execute()
Magento\Variable\Controller\Adminhtml\System\Variable\Delete
Definition:
Delete.php:9
Magento\Variable\Controller\Adminhtml\System\Variable
Definition:
Variable.php:13
Magento\Variable\Controller\Adminhtml\System\Variable
Definition:
Delete.php:7