14 class Formgroup extends \Magento\Backend\Block\Widget\Form\Generic
32 \
Magento\Eav\Model\Entity\TypeFactory $typeFactory,
35 $this->_typeFactory = $typeFactory;
45 $form = $this->_formFactory->create();
47 $fieldset = $form->addFieldset(
'set_fieldset', [
'legend' =>
__(
'Add New Group')]);
50 'attribute_group_name',
52 [
'label' =>
__(
'Name'),
'name' =>
'attribute_group_name',
'required' =>
true]
59 'text' => $this->
getLayout()->createBlock(
60 \
Magento\Backend\Block\Widget\Button::class
62 [
'label' =>
__(
'Add Group'),
'onclick' =>
'this.form.submit();',
'class' =>
'add']
70 [
'name' =>
'attribute_set_id',
'value' => $this->
_getSetId()]
73 $form->setUseContainer(
true);
74 $form->setMethod(
'post');
75 $form->setAction($this->
getUrl(
'catalog/product_group/save'));
88 ) : $this->_typeFactory->create()->load(
89 $this->_coreRegistry->registry(
'entityType')
90 )->getDefaultAttributeSetId();
__construct(\Magento\Backend\Block\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Data\FormFactory $formFactory, \Magento\Eav\Model\Entity\TypeFactory $typeFactory, array $data=[])
getUrl($route='', $params=[])
setData($key, $value=null)