I want to create a special function to manipulate HTMLText Content.
So this should return the manipulated $Content
$Content.Foobar
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I want to create a special function to manipulate HTMLText Content.
So this should return the manipulated $Content
$Content.Foobar
Thats where the TextParser is for :)
http://doc.silverstripe.org/recipes:syntax-highlighting#text-parser
Simple example I use :
Thanks! Does it also work for Varchar?
I tried to apply it to a TextField, but that does not seems to work...
If you were to look at the docs or the code it would be obvious that the Parse method is only in 'class Text'
http://api.silverstripe.org/trunk/sapphire/model/Varchar.html
http://api.silverstripe.org/trunk/sapphire/model/Text.html
Trying was quicker at the moment ;)
Martijn the comment wasn't really directed at you, it was for others I feel the need to remind of how easily something can be checked in help / api docs / code.
Personally I use netbeans it is very fast to check code for an existing method (as the code completion is correct and fast) and the for docs I keep a short cut to http://api.silverstripe.org/trunk/elementindex.html and Ctrl+F searches fast too.
Is there a way to do this that would work with Varchar as well as Text and HTMLText?