# \hhu\zUtils

Class for implementing utility methods.

## Summary

Methods
Properties
Constants
t()
htmlspecialchars_utf8()
shortenString()
sendMail()
getMimetype()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  app/Utils.inc
Package
  Default
Class hierarchy
  \hhu\z\Utils

## Tags

author | Oliver Hanraths oliver.hanraths@uni-duesseldorf.de

## Methods

### t()

    t(string  $string) : string

Mask HTML-chars for save output.

#### Parameters

string | $string | String to be masked

#### Returns

string —

Masked string

#

static

## Tags

static |

### htmlspecialchars_utf8()

    htmlspecialchars_utf8(string  $string) : string

‚htmlspecialchars‘ with support for UTF-8.

#### Parameters

string | $string | String to be masked

#### Returns

string —

Masked string

#

static

## Tags

static |

### shortenString()

    shortenString(string  $string, integer  $length, integer  $scope) : string

Cut a string to the given length but only word boundaries.

#### Parameters

string | $string | String to cut
integer | $length | Length to cut string
integer | $scope | Maximum length to cut string regardless word boundaries

#### Returns

string —

Cutted string

#

static

## Tags

static |

### sendMail()

    sendMail(mixed  $to, string  $messageAction, boolean  $html = false, array  $params = null, \nre\core\Linker  $linker = null)

Send an e‑mail.

#### Parameters

mixed | $to | One (string) or many (array) receivers
string | $messageAction | Message Action
boolean | $html | Whether mail should be formatted as HTML or not
array | $params | Parameters to pass
\nre\core\Linker | $linker | Linker instance

#### Throws

\hhu\z\exceptions\MailingException

#

static

## Tags

None found

### getMimetype()

    getMimetype(string  $filename, string  $defaultMimetype = null) : string

Detect Mimetype of a file.

#### Parameters

string | $filename | Name of file to detect Mimetype of
string | $defaultMimetype | Default Mimetype to use

#### Returns

string —

Detected Mimetype of file

#

static

## Tags

None found

### Utils.inc