28 protected $_template =
'Magento_Backend::widget/form.phtml';
36 parent::__construct($context,
$data);
48 $this->setDestElementId(
'edit_form');
49 $this->setShowGlobalIcon(
false);
80 return parent::_prepareLayout();
100 if (is_object($this->
getForm())) {
101 return $this->
getForm()->getHtml();
114 $this->_form = $form;
115 $this->_form->setParent($this);
116 $this->_form->setBaseUrl($this->_urlBuilder->getBaseUrl());
118 $customAttributes = $this->
getData(
'custom_attributes');
119 if (is_array($customAttributes)) {
120 foreach ($customAttributes as $key =>
$value) {
121 $this->_form->addCustomAttribute($key,
$value);
146 return parent::_beforeToHtml();
176 if (($inputType =
$attribute->getFrontend()->getInputType()) && !in_array(
179 ) && (
'media_image' != $inputType ||
$attribute->getAttributeCode() ==
'image')
181 $fieldType = $inputType;
182 $rendererClass =
$attribute->getFrontend()->getInputRendererClass();
183 if (!empty($rendererClass)) {
184 $fieldType = $inputType .
'_' .
$attribute->getAttributeCode();
185 $fieldset->addType($fieldType, $rendererClass);
193 'label' =>
$attribute->getFrontend()->getLocalizedLabel(),
194 'class' =>
$attribute->getFrontend()->getClass(),
198 )->setEntityAttribute(
230 switch ($inputType) {
239 $element->setDateFormat($this->_localeDate->getDateFormatWithLongYear());
getData($key='', $index=null)