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-catalog
Block
Adminhtml
Product
Attribute
Set
Main
Formattribute.php
Go to the documentation of this file.
1
<?php
10
namespace
Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main
;
11
12
use
Magento\Backend\Block\Widget\Form
;
13
14
class
Formattribute
extends
\Magento\Backend\Block\Widget\Form\Generic
15
{
19
protected
function
_prepareForm
()
20
{
22
$form = $this->_formFactory->create();
23
24
$fieldset = $form->addFieldset(
'set_fieldset'
, [
'legend'
=>
__
(
'Add New Attribute'
)]);
25
26
$fieldset->addField(
27
'new_attribute'
,
28
'text'
,
29
[
'label'
=>
__
(
'Name'
),
'name'
=>
'new_attribute'
,
'required'
=>
true
]
30
);
31
32
$fieldset->addField(
33
'submit'
,
34
'note'
,
35
[
36
'text'
=> $this->
getLayout
()->createBlock(
37
\
Magento
\Backend\Block\Widget\Button::class
38
)->
setData
(
39
[
'label'
=>
__
(
'Add Attribute'
),
'onclick'
=>
'this.form.submit();'
,
'class'
=>
'add'
]
40
)->
toHtml
()
41
]
42
);
43
44
$form->setUseContainer(
true
);
45
$form->setMethod(
'post'
);
46
$this->
setForm
($form);
47
}
48
}
Magento\Backend\Block\Widget\Form\setForm
setForm(\Magento\Framework\Data\Form $form)
Definition:
Form.php:112
Magento\Backend\Block\Widget\Form\_prepareForm
_prepareForm()
Definition:
Form.php:132
Magento\Framework\View\Element\BlockInterface\toHtml
toHtml()
__
__()
Definition:
__.php:13
Magento\Backend\Block\Widget\Form
Definition:
ContainerTest.php:6
Magento\Framework\View\Element\AbstractBlock\getLayout
getLayout()
Definition:
AbstractBlock.php:295
Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main\Formattribute
Definition:
Formattribute.php:14
Magento
Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main
Definition:
Formattribute.php:10
Magento\Framework\DataObject\setData
setData($key, $value=null)
Definition:
DataObject.php:72