src/MvcCore/Ext/View/Helpers/LineBreaksHelper.php
protected function processWeakWord ($word) {
		$index = 0;
		$text = ' ' . $this->text . ' ';
		// go through infinite loop and process given week word with html fixed spaces replacement
		while (TRUE) {
			$index = mb_strpos($text, ' ' . $word . ' ');
			if ($index !== FALSE) {
				// If there is any week word and basic white space
				// before and after the week word in source text:
				//	- take all source text before week word including white space before week word,
				//	- take week word
				//	- add fixed space html entity
				//	- and add all rest source text after week word
				//	  and white space char after week word
				$text = mb_substr($text, 0, $index + 1) . $word . '&nbsp;' . mb_substr($text, $index + 1 + mb_strlen($word) + 1);
				// move $index variable after position, where is source text already processed
				$index += 1 + mb_strlen($word) + 6; // (6 - means length of space html entity: '&nbsp;'
			} else {
				// there is no other occurrence of week word in source text
				break;
			}
		}
		$this->text = mb_substr($text, 1, mb_strlen($text) - 2);
	}
protected function processWeakWord ($word) {
		$index = 0;
		$text = ' ' . $this->text . ' ';
		// go through infinite loop and process given week word with html fixed spaces replacement
		while (TRUE) {
			$index = mb_strpos($text, ' ' . $word . ' ');
			if ($index !== FALSE) {
				// If there is any week word and basic white space
				// before and after the week word in source text:
				//	- take all source text before week word including white space before week word,
				//	- take week word
				//	- add fixed space html entity
				//	- and add all rest source text after week word
				//	  and white space char after week word
				$text = mb_substr($text, 0, $index + 1) . $word . '&nbsp;' . mb_substr($text, $index + 1 + mb_strlen($word) + 1);
				// move $index variable after position, where is source text already processed
				$index += 1 + mb_strlen($word) + 6; // (6 - means length of space html entity: '&nbsp;'
			} else {
				// there is no other occurrence of week word in source text
				break;
			}
		}
		$this->text = mb_substr($text, 1, mb_strlen($text) - 2);
	}
protected function processWeakWord ( $ word ) { $ index = 0 ; $ text = ' ' . $ this -> text . ' ' ; // go through infinite loop and process given week word with html fixed spaces replacement while ( TRUE ) { $ index = mb_strpos ( $ text , ' ' . $ word . ' ' ) ; if ( $ index !== FALSE ) { // If there is any week word and basic white space // before and after the week word in source text: //	- take all source text before week word including white space before week word, //	- take week word //	- add fixed space html entity //	- and add all rest source text after week word //	  and white space char after week word $ text = mb_substr ( $ text , 0 , $ index + 1 ) . $ word . '&nbsp;' . mb_substr ( $ text , $ index + 1 + mb_strlen ( $ word ) + 1 ) ; // move $index variable after position, where is source text already processed $ index += 1 + mb_strlen ( $ word ) + 6 ; // (6 - means length of space html entity: '&nbsp;' } else { // there is no other occurrence of week word in source text break ; } } $ this -> text = mb_substr ( $ text , 1 , mb_strlen ( $ text ) - 2 ) ; }
Process single weak word - place HTML space entity
where is necessary to not line break source text where it's not wanted.
@param string $word
@return void
Process single weak word - place HTML space entity where is necessary to not line break source text where it s not wanted .