/** * Set form object * * @param \Magento\Framework\Data\Form $form * @return $this */ public function setForm(\Magento\Framework\Data\Form $form) { $this->_form = $form; $this->_form->setParent($this); $this->_form->setBaseUrl($this->_urlBuilder->getBaseUrl()); $customAttributes = $this->getData('custom_attributes'); if (is_array($customAttributes)) { foreach ($customAttributes as $key => $value) { $this->_form->addCustomAttribute($key, $value); } } return $this; }