protected function onAttributeChange($name, $value = null) { if ('type' == $name) { throw new HTML_QuickForm2_InvalidArgumentException("Attribute 'type' is read-only"); } parent::onAttributeChange($name, $value); }
/** * Intercepts setting 'name' and 'id' attributes * * Overrides parent method to allow removal of 'name' attribute on Static * elements * * @param string Attribute name * @param string Attribute value, null if attribute is being removed * @throws HTML_QuickForm2_InvalidArgumentException if trying to * remove a required attribute */ protected function onAttributeChange($name, $value = null) { if ('name' == $name && null === $value) { unset($this->attributes['name']); } else { parent::onAttributeChange($name, $value); } }