title: Adding a Custom Form Element to an Adminhtml Form
body: <p>Is there a way to add a custom form element to a Magento Adminhtml form without placing the custom element in the <code>lib/Varian</code> folder?</p>
  
  <p>I've tracked down the code that's essentially a <code>Varian_Data_Form_Element_</code> factory</p>
  
  <pre><code>public function addField($elementId, $type, $config, $after=false)
  {
      if (isset($this-&gt;_types[$type])) {
          $className = $this-&gt;_types[$type];
      }
      else {
          $className = 'Varien_Data_Form_Element_'.ucfirst(strtolower($type));
      }
      $element = new $className($config);
      $element-&gt;setId($elementId);
      if ($element-&gt;getRequired()) {
          $element-&gt;addClass('required-entry');
      }
      $this-&gt;addElement($element, $after);
      return $element;
  }
  </code></pre>
  
  <p>So, if I'm reading this correctly, I ensure that an EAV attribute's frontend returns a specific fieldType, (such as <code>supertextfield</code>) and the system will instantiate/render a  <code>Varien_Data_Form_Element_Supertextfield</code> when displaying this attribute's editing form.</p>
  
  <p>This is well and good, but it means I need to include my custom form element in the <code>lib/Varian</code> folder hierarchy.  Given how module oriented Magento is, it seems like this is doing it wrong.</p>
  
  <p>I realize I could jank around with a custo autoloader or symlinks in the lib, but I'm primarily interested in learning if there's </p>
  
  <ol>
  <li><p>A canonical way to add custom form elements for attributes</p></li>
  <li><p>A canonical way to customize the Magento autoloader.</p></li>
  </ol>