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-backend
Ui
Component
Control
SaveSplitButton.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Backend\Ui\Component\Control
;
7
8
use
Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface
;
9
use
Magento\Ui\Component\Control\Container
;
10
17
class
SaveSplitButton
implements
ButtonProviderInterface
18
{
22
private
$targetName;
23
27
public
function
__construct
(
string
$targetName)
28
{
29
$this->targetName = $targetName;
30
}
31
35
public
function
getButtonData
()
36
{
37
return
[
38
'label'
=>
__
(
'Save & Continue'
),
39
'class'
=>
'save primary'
,
40
'data_attribute'
=> [
41
'mage-init'
=> [
42
'buttonAdapter'
=> [
43
'actions'
=> [
44
[
45
'targetName'
=> $this->targetName,
46
'actionName'
=>
'save'
,
47
'params'
=> [
48
// first param is redirect flag
49
false
,
50
]
51
]
52
]
53
]
54
]
55
],
56
'class_name'
=>
Container::SPLIT_BUTTON
,
57
'options'
=> $this->getOptions(),
58
'sort_order'
=> 40,
59
];
60
}
61
65
private
function
getOptions(): array
66
{
67
$options
= [
68
[
69
'label'
=>
__
(
'Save & Close'
),
70
'data_attribute'
=> [
71
'mage-init'
=> [
72
'buttonAdapter'
=> [
73
'actions'
=> [
74
[
75
'targetName'
=> $this->targetName,
76
'actionName'
=>
'save'
,
77
'params'
=> [
78
// first param is redirect flag
79
true
,
80
],
81
],
82
],
83
],
84
],
85
],
86
'sort_order'
=> 10,
87
],
88
[
89
'label'
=>
__
(
'Save & New'
),
90
'data_attribute'
=> [
91
'mage-init'
=> [
92
'buttonAdapter'
=> [
93
'actions'
=> [
94
[
95
'targetName'
=> $this->targetName,
96
'actionName'
=>
'save'
,
97
'params'
=> [
98
// first param is redirect flag, second is data that will be added to post
99
// request
100
true
,
101
[
102
'redirect_to_new'
=> 1,
103
],
104
],
105
],
106
],
107
],
108
],
109
],
110
'sort_order'
=> 20,
111
],
112
];
113
return
$options
;
114
}
115
}
Magento\Backend\Ui\Component\Control\SaveSplitButton\__construct
__construct(string $targetName)
Definition:
SaveSplitButton.php:27
Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface
Definition:
ButtonProviderInterface.php:11
Magento\Ui\Component\Control\Container\SPLIT_BUTTON
const SPLIT_BUTTON
Definition:
Container.php:20
__
__()
Definition:
__.php:13
Magento\Backend\Ui\Component\Control\SaveSplitButton
Definition:
SaveSplitButton.php:17
Magento\Ui\Component\Control\Container
Definition:
Container.php:14
Magento\Backend\Ui\Component\Control
Definition:
DeleteButton.php:8
Magento\Backend\Ui\Component\Control\SaveSplitButton\getButtonData
getButtonData()
Definition:
SaveSplitButton.php:35
$options
$options
Definition:
multiple_mixed_products.php:29