set encoding type of form
'application/x-www-form-urlencoded' and 'multipart/form-data' are the only allowed values

@param string $type
@return HtmlForm
@throws HtmlFormException
18504
public function setEncType($type) {

		$type = strtolower($type);

		if($type != 'application/x-www-form-urlencoded' && $type != 'multipart/form-data' && !empty($type)) {
			throw new HtmlFormException("Invalid form enctype: '$type'.", HtmlFormException::INVALID_ENCTYPE);
		}

		$this->encType = $type;

		return $this;

	}
1194794
public function setType($type)
    {
        if (!isset($this->types[$type])) {
            throw new InvalidArgumentException('type must be one of:' . implode(', ', array_keys($this->types)));
        }

        $this->type = $type;

        return $this;
    }
1374452
public function setType($type)
    {
        $const = sprintf('%s::TYPE_%s', __CLASS__, strtoupper($type));
        
        if(defined($const))
        {
            $type = constant($const);
        }
        
        $this->setAttributeDirectly('type', $type);
        
        $this->enumerationStrategy = null;
    }
674788
public function setMimeEncoding($type = 'text/html', $sync = true)
	{
		$this->_mime = strtolower($type);

		// Syncing with meta-data
		if ($sync)
		{
			$this->setMetaData('content-type', $type, true, false);
		}

		return $this;
	}
792926
public function setType(string $type): Button
    {
        $types = [
            'submit',
            'reset',
            'button'
        ];

        if (! in_array($type, $types)) {
            Throw new FormException('Wrong button type set.');
        }

        $this->type = $type;

        return $this;
    }
855946
public function setType($type)
    {
        $this->type = $type;

        if (static::isSodiumAlgo($this->type)) {
            if (!extension_loaded('libsodium')) {
                throw new \DomainException('Please install php ext-libsodium >= 1.0.9 to use sodium pwhash().');
            }

            if (!defined('\Sodium\CRYPTO_PWHASH_SALTBYTES')) {
                throw new \DomainException('Libsodium must higher than 1.0.9 to use Argon2 and Scrypt algo.');
            }
        }

        return $this;
    }
154988
protected function _format($type) {
        $response = array(
            'success' => $this->_success,
            'data' => $this->_data
        );

        if ($this->_code) {
            $response['code'] = $this->_code;
        }

        switch (strtolower($type)) {
            case 'json':
                $format = TypeConverter::toJson($response);
            break;
            case 'xml':
                $format = TypeConverter::toXml($response);
            break;
            case 'html';
            case 'text':
            default:
                $format = (string) $this->_data;
            break;
        }

        return $format;
    }
763911
public static function contentType($type, $charset = 'utf-8'){
        $type = isset( self::$types[$type] ) ? self::$types[$type] : $type;
        self::set('Content-Type: '. $type. '; charset='. $charset);
    }
842004
public function htmld($type = ENT_COMPAT, $encode = 'UTF-8')
    {
        $this->string = html_entity_decode($this->string, $type, $encode);

        return $this;
    }
866303
public function setOutputType($type)
    {
        if (preg_match('/(png|gif|jpe?g|tif?f|webp)/i', $type)) {
            $this->outputType = sprintf('image/%s', strtolower($type));
            return;
        } else {
            throw new \InvalidArgumentException(sprintf('Invalid output format %s', $type));
        }
    }
172610
static private function setMimeType()
	{
		$UserBrowser = '';
		if( preg_match( '@Opera(/| )([0-9].[0-9]{1,2})@', $_SERVER['HTTP_USER_AGENT'] ) )
			$UserBrowser = "Opera";
		elseif( preg_match( '@MSIE ([0-9].[0-9]{1,2})@', $_SERVER['HTTP_USER_AGENT'] ) )
			$UserBrowser = "IE";
		$mime_type = ( $UserBrowser == 'IE' || $UserBrowser == 'Opera' ) ? 'application/octetstream' : 'application/octet-stream';
		header( "Content-Type: ". $mime_type);
	}
325345
protected function createContent($type)
    {
        if ($type == 'json') {
            $this->headers['content_type'] = 'application/json; charset=UTF-8';

            return json_encode(['url' => $this->ch, 'status' => 'ok']);
        } elseif ($type == 'xml') {
            $this->headers['content_type'] = 'text/xml; charset=UTF-8';

            return '<?xml version="1.0" encoding="UTF-8"?><result><url>'.$this->ch.'</url><status>ok</status></result>';
        }

        return 'ok';
    }
189773
public function setType($type): Input
    {
        $types = [
            'button',
            'checkbox',
            'color',
            'date',
            'datetime',
            'datetime-local',
            'email',
            'file',
            'hidden',
            'image',
            'month',
            'number',
            'password',
            'radio',
            'range',
            'reset',
            'search',
            'submit',
            'tel',
            'text',
            'time',
            'url',
            'week '
        ];

        if (!in_array($type, $types)) {
            Throw new FormException('Your type "' . $type . '" is no valid input control type. Allowed are ' . implode(', ', $types));
        }

        $this->type = $type;
        $this->attribute['type'] = $type;
        $this->data['control'] = $type == 'hidden' ? 'hidden' : 'input';

        return $this;
    }
658126
protected function setType($type)
    {
        if ($type == '*/*' || $type == 'application/octet-stream')
        {
            $type = \Module\HttpFoundation\getMimeTypeOfFile($this->getTmpName(), false);
            if ( empty($type) )
                if ( null !== $solved = \Module\HttpFoundation\getMimeTypeOfFile($this->getClientFilename()) )
                    $type = $solved;
                else
                    $type = 'application/octet-stream';
        }

        $this->type = (string) $type;
        return $this;
    }
926360
public function setType($type)
    {
        $this->type = $type;

        switch ($type) {
            case 'text':
            case 'string':
                $this->operatorOpts = ['equals', 'notequals', 'contains'];
                break;
            case 'integer':
                $this->operatorOpts = ['equals', 'notequals', 'greaterthan', 'lessthan'];
                break;
            case 'boolean':
                $this->operatorOpts = ['equals'];
                break;
        }

        return $this;
    }
1070213
public function setContentType($contentType) {
    $this->contentType = $contentType;
    
    $ct = $this->contentType;
    if (isset($this->charset))
      $ct .= '; charset='.$this->charset;

    $this->setMeta('content-type',$ct, TRUE);
  }
244265
public function setType($type)
    {
        if ($this->formHelper->getFieldType($type)) {
            $this->type = $type;
        }

        return $this;
    }