Using Latte's stripHtml filter within a presenter?
- TerryTibbs
- Member | 5
Hi all,
Is there any easy way to use Latte's stripHtml filter from within a presenter? I have looked through Nette\Utils\Strings to see if there was something similar in there but it appears not.
I am using the full framework.
Thanks in advance
- Pepino
- Member | 256
https://github.com/…/Filters.php#L32
https://github.com/…/Filters.php#L249
Last edited by Pepino (2024-06-17 20:35)
- TerryTibbs
- Member | 5
Ah thanks. So I can just call the following within the presenter?
$stripped = Latte\Runtime\Filters::convertHtmlToText($title);
- Rick Strafy
- Nette Blogger | 81
You'll just call what those methods are calling
html_entity_decode(strip_tags($s), ENT_QUOTES | ENT_HTML5, 'UTF-8')
Because both classes are marked as internal, so there is no guarantee that method names/parameters or classes will not change.