# TextHelper

`class` **TextHelper**(View $view, array $settings = [])

The TextHelper contains methods to make text more usable and
friendly in your views. It aids in enabling links, formatting URLs,
creating excerpts of text around chosen words or phrases,
highlighting key words in blocks of text, and gracefully
truncating long stretches of text.

::: info Changed in version 2.1
Several `TextHelper` methods have been moved into the `CakeText` class (called `String` before 2.7) to allow easier use outside of the `View` layer. Within a view, these methods are accessible via the TextHelper class. You can call one as you would call a normal helper method: `$this->Text->method($args);`.
:::

`method` TextHelper::**autoLinkEmails**(string $text, array $options=[])

`method` TextHelper::**autoLinkUrls**(string $text, array $options=[])

`method` TextHelper::**autoLink**(string $text, array $options=[])

`method` TextHelper::**autoParagraph**(string $text)

<!-- start-string -->

`method` CakeText::**highlight**(string $haystack, string $needle, array $options = [] )

`method` CakeText::**stripLinks**($text)

`method` CakeText::**truncate**(string $text, int $length=100, array $options)

::: info Changed in version 2.3
`ending` has been replaced by `ellipsis`. `ending` is still used in 2.2.1
:::

`method` CakeText::**tail**(string $text, int $length=100, array $options)

`method` CakeText::**excerpt**(string $haystack, string $needle, integer $radius=100, string $ellipsis="...")

`method` CakeText::**toList**(array $list, $and='and')

<!-- end-string -->
