Jump to:

3439 Posts in 1028 Topics by 869 members

Template Questions

SilverStripe Forums » Template Questions » sprintf two and more aguments

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

Page: 1
Go to End
Author Topic: 1150 Views
  • Tonyair
    Community Member
    81 Posts

    sprintf two and more aguments Link to this post

    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?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.