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.

Template Questions /

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

sprintf two and more aguments


Go to End


1866 Views

Avatar
Tonyair

Community Member, 81 Posts

10 June 2010 at 7:33pm

Hello, I'm using sprintf functions in template

<% sprintf( _t('POST_DATE'), $Date.Nice ) %> <% sprintf( _t('POST_AUTHOR'), $Author ) %>

Everything works fine, but when I'm merging this, I'm getting following error:

<% sprintf( _t('POST'), $Date.Nice, $Author) %>

This page contains the following errors:
error on line 102 at column 3: StartTag: invalid element name
Below is a rendering of the page up to the first error.
(Of course, I had also added $lang['en_US']['ArticlePage.ss']['POST'] = '%s %s'; string inside lang file)

So is there anyway to merge this strings in one?