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

TextareaField add attribute "wrap"


Go to End


3 Posts   1578 Views

Avatar
swaiba

Forum Moderator, 1899 Posts

23 February 2011 at 4:46am

I'm looking at adding an attribute (wrap) to a TextareaField - I've yet to find an $field->AddAttribute(name,val) - can anyone help with this please?

Avatar
martimiz

Forum Moderator, 1391 Posts

25 February 2011 at 1:07am

As far as I see it's not there :-( All attributes seem to be hardcoded into the FormField::Fields() method, that calls the FormField::createTag() that in turn only creates attributes it receives in its param list. I've tried following the chain of methods involved in creating a field, and it won't be simple to wriggle in some general AddAttributes() thing - definitely not without changing core...

So probably it's extending the TextareaField - unless I'm totally missing something...

Avatar
swaiba

Forum Moderator, 1899 Posts

25 February 2011 at 10:46pm

shame - that seems a bit basic to add something like that :(