We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I want to get the translations of the dataobject from within another controller. Is it possible to do that:
Example:
$sms_data_s = DataObject::get_by_id('SMSTemplate', 1)->SMSContent;
I have translations for SMSContent, but don't know how to call them.
The text was updated successfully, but these errors were encountered:
Have you tried using getLocalizedValue or the shortcut T? Eg. Something like this:
getLocalizedValue
T
$sms_data_s = DataObject::get_by_id('SMSTemplate', 1)->T('SMSContent');
Btw. If you're using SilverStripe 3.1 or newer, I suggest you use the newer syntax to get your DataObject:
$sms_data_s = SMSTemplate::get()->byID(1)->T('SMSContent');
Sorry, something went wrong.
bummzack
No branches or pull requests
Hi,
I want to get the translations of the dataobject from within another controller. Is it possible to do that:
Example:
I have translations for SMSContent, but don't know how to call them.
The text was updated successfully, but these errors were encountered: