heldercervantes Posted December 20, 2016 Share Posted December 20, 2016 Hello chaps. Anyone know a smart (as in short and sweet) way of rendering a textarea that is configured to use CKedit, as plain text? The regular, html version of the field's content is used on the page, but then I need a clean alternative version for some cases. Thanks, H Link to comment Share on other sites More sharing options...
kongondo Posted December 20, 2016 Share Posted December 20, 2016 $out = strip_tags($page->body); echo $out; strip_tags is one way to do it. I'm not sure about performance on a large body of text though. Maybe regex would be faster, I don't know 1 Link to comment Share on other sites More sharing options...
adrian Posted December 20, 2016 Share Posted December 20, 2016 strip_tags is the simplest for sure. If you want more control, try the textarea sanitizer: https://github.com/processwire/processwire/blob/35df716082b779de0e53a3fcf7996403c49c9f8a/wire/core/Sanitizer.php#L1022 2 Link to comment Share on other sites More sharing options...
heldercervantes Posted December 22, 2016 Author Share Posted December 22, 2016 Thanks guys. Strip_tags worked like a charm Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now