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:

Template Questions /

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

sprintf two and more aguments


Go to End


1576 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?