addFieldset('some_fieldset', array('legend' => 'Some Fieldset')); $fieldset->addField('some_field', 'text', array( 'label' => 'Some Field', 'name' => 'some_field' )); $element = $fieldset->getElement('some_field'); $formElement = $element->getForm(); ?>
setType('my_form_element'); parent::_construct(); } public function getForm() { return $this->_form; } } ?>In this example, we create a custom form element, extending the Varien_Data_Form_Element_Abstract class. We override the _construct method to set the type of our form element, and then we define our custom getForm method that returns the form object to which this element belongs. The package library for this method is Magento_Core, which is a core component of the Magento platform.