Example #1
0
 /**
  * Convert custom (form specific) type to general factory type.
  * 
  * @param string $type     (in/out) Element type
  * @param array  $options  (in/out) Element options
  * @param array  $attr     (in/out) HTML attributes
  */
 protected function convertCustomType(&$type, array &$options, array &$attr = [])
 {
     if (isset($this->builder)) {
         $this->builder->convertCustomType($type, $options, $attr);
         return;
     }
     if (isset($this->customTypes[$type])) {
         $custom = $this->customTypes[$type];
         $type = $custom[0];
         if (isset($custom[1])) {
             $options = $custom[1] + $options;
         }
         if (isset($custom[2])) {
             $attr = $custom[2] + $attr;
         }
     }
 }