From: Carsten K. <car...@ma...> - 2001-12-19 15:13:24
|
Hi, Found my problem using sprintf in the html templates! Turns out that variables in bracket form on the templates need to be quoted "${var}" or else they aren't eval()'d. -<?php echo sprintf(_("Last edited on %s."),${LASTMODIFIED}); ?> +<?php printf(_("Last edited on %s."),"${LASTMODIFIED}"); ?> Thanks for the tip about printf. Also the new variable reordering functions sound great. I'll try them later today. carsten On Tuesday, December 18, 2001, at 08:09 pm, Jeff Dairiki wrote: > Carsten Klapp said: > >> 1. Variable reordering. > > That's a problem. PHP doesn't seem to support the printf > argument reordering... > > I'll see if I can think of a work-around. > >> 2. Strings in the html template don't seem to substitute for %s. >> I tried: >> <?php echo sprintf(_("haystack %s"),_("needle")); ?> > > That works for me. I just tried it. > Also note that 'printf(...);' is equivalent to 'echo sprintf(...);'. |