Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How can I manipulate HTMLText Content?


Go to End


9 Posts   2043 Views

Avatar
DeklinKelly

Community Member, 197 Posts

7 October 2010 at 4:10am

I want to create a special function to manipulate HTMLText Content.

So this should return the manipulated $Content
$Content.Foobar

Avatar
Martijn

Community Member, 271 Posts

7 October 2010 at 4:26am

Avatar
DeklinKelly

Community Member, 197 Posts

7 October 2010 at 4:53am

Thanks! Does it also work for Varchar?

Avatar
Martijn

Community Member, 271 Posts

7 October 2010 at 5:24am

I tried to apply it to a TextField, but that does not seems to work...

Avatar
swaiba

Forum Moderator, 1899 Posts

7 October 2010 at 5:35am

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

Avatar
Martijn

Community Member, 271 Posts

7 October 2010 at 5:40am

Trying was quicker at the moment ;)

Avatar
swaiba

Forum Moderator, 1899 Posts

7 October 2010 at 5:46am

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.

Avatar
DeklinKelly

Community Member, 197 Posts

7 October 2010 at 7:49am

Is there a way to do this that would work with Varchar as well as Text and HTMLText?

Go to Top