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've moved the forum!

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.

Form Questions /

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

Fieldset and


Go to End


2 Posts   1450 Views

Avatar
biapar

Forum Moderator, 435 Posts

22 January 2010 at 2:56am

Hi,

How can I use multilanguage feature like <% _t('Events.Upcoming_Events',"Upcoming Events") %> into TextField,HeaderField,ecc code?

//Create Form
$fields = new FieldSet(
new FieldGroup (
new HeaderField('Personal Information', 3),
new TextField('FirstName', 'Nome / First Name', $member->FirstName),
ecc..

Thank you

Avatar
Willr

Forum Moderator, 5523 Posts

22 January 2010 at 4:29pm

You can use the same syntax that you use from templates - the _t function works in both.

new TextField('FirstName', _t('MyForm.FIRSTNAME', 'First Name'))