-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathEdit.php
More file actions
executable file
·47 lines (41 loc) · 1.32 KB
/
Edit.php
File metadata and controls
executable file
·47 lines (41 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace Astound\Affirm\Block\Adminhtml\Rule;
class Edit extends \Magento\Backend\Block\Widget\Form\Container
{
protected $_coreRegistry = null;
public function __construct(
\Magento\Backend\Block\Widget\Context $context,
\Magento\Framework\Registry $registry,
array $data = []
) {
$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
protected function _construct()
{
$this->_objectId = 'id';
$this->_controller = 'adminhtml_rule';
$this->_blockGroup = 'Astound_Affirm';
parent::_construct();
$this->buttonList->add(
'save_and_continue_edit',
[
'class' => 'save',
'label' => __('Save and Continue Edit'),
'data_attribute' => [
'mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']],
]
],
10
);
}
public function getHeaderText()
{
$model = $this->_coreRegistry->registry('affirm_payment_restriction_rule');
if ($model->getId()) {
$title = __('Edit Payment Restriction Rule `%1`', $model->getName());
} else {
$title = __("Add new Payment Restriction Rule");
}
}
}