public static function dynamic($type, $name, $value, array $attributes = array(), $extra = array())
    {
        switch ($type) {
            case 'text':
                return self::text($name, $value, $attributes);
            case 'password':
                return self::password($name, $value, $attributes);
            case 'url':
                return self::url($name, $value, $attributes);
            case 'range':
                return self::range($name, $value, $attributes);
            case 'number':
                return self::number($name, $value, $attributes);
            case 'hidden':
                return self::hidden($name, $value, $attributes);
            case 'date':
                return self::date($name, $value, $attributes);
            case 'time':
                return self::time($name, $value, $attributes);
            case 'color':
                return self::color($name, $value, $attributes);
            case 'textarea':
                return self::textarea($name, $value, $attributes);
            case 'radio':
                return self::radio($name, $value, (bool) $value, $attributes);
            case 'checkbox':
                return self::checkbox($name, $value, $attributes, false);
            case 'select':
                return self::select($name, $extra, $value, $attributes);
            default:
                throw new UnexpectedValueException(sprintf('Unexpected value supplied %s', $type));
        }
    }