src/View/Helper/TextHelper.php
public function minimizeUrl($url, $max = null, array $options = []) {
		// check if there is nothing to do
		if (empty($url) || mb_strlen($url) <= (int)$max) {
			return $url;
		}
		// http:// etc has not to be displayed, so
		$url = Utility::stripProtocol($url);
		// cut the parameters
		if (mb_strpos($url, '/') !== false) {
			$url = strtok($url, '/');
		}
		// return if the url is short enough
		if (mb_strlen($url) <= (int)$max) {
			return $url;
		}
		// otherwise cut a part in the middle (but only if long enough!)
		// TODO: more dynamically
		$placeholder = CHAR_HELLIP;
		if (!empty($options['placeholder'])) {
			$placeholder = $options['placeholder'];
		}

		$end = mb_substr($url, -5, 5);
		$front = mb_substr($url, 0, (int)$max - 8);
		return $front . $placeholder . $end;
	}
public function minimizeUrl($url, $max = null, array $options = []) {
		// check if there is nothing to do
		if (empty($url) || mb_strlen($url) <= (int)$max) {
			return $url;
		}
		// http:// etc has not to be displayed, so
		$url = Utility::stripProtocol($url);
		// cut the parameters
		if (mb_strpos($url, '/') !== false) {
			$url = strtok($url, '/');
		}
		// return if the url is short enough
		if (mb_strlen($url) <= (int)$max) {
			return $url;
		}
		// otherwise cut a part in the middle (but only if long enough!)
		// TODO: more dynamically
		$placeholder = CHAR_HELLIP;
		if (!empty($options['placeholder'])) {
			$placeholder = $options['placeholder'];
		}

		$end = mb_substr($url, -5, 5);
		$front = mb_substr($url, 0, (int)$max - 8);
		return $front . $placeholder . $end;
	}
public function minimizeUrl ( $ url , $ max = null , array $ options = [ ] ) { // check if there is nothing to do if ( empty ( $ url ) || mb_strlen ( $ url ) <= ( int ) $ max ) { return $ url ; } // http:// etc has not to be displayed, so $ url = Utility :: stripProtocol ( $ url ) ; // cut the parameters if ( mb_strpos ( $ url , '/' ) !== false ) { $ url = strtok ( $ url , '/' ) ; } // return if the url is short enough if ( mb_strlen ( $ url ) <= ( int ) $ max ) { return $ url ; } // otherwise cut a part in the middle (but only if long enough!) // TODO: more dynamically $ placeholder = CHAR_HELLIP ; if ( ! empty ( $ options [ 'placeholder' ] ) ) { $ placeholder = $ options [ 'placeholder' ] ; } $ end = mb_substr ( $ url , - 5 , 5 ) ; $ front = mb_substr ( $ url , 0 , ( int ) $ max - 8 ) ; return $ front . $ placeholder . $ end ; }
Minimizes the given URL to a maximum length

@param string $url the url
@param int|null $max the maximum length
@param array $options
- placeholder
@return string the manipulated url (+ eventuell ...)
Minimizes the given URL to a maximum length