Zend Framework

Documentation about using multiple parameters in a string has an unwanted backslash

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Not an Issue
  • Affects Version/s: 1.9.6
  • Fix Version/s: 1.9.7
  • Component/s: Zend_Translate
  • Labels:
    None

Description

The documentation (http://framework.zend.com/manual/en/zend.translate.using.html) describes how you can use multiple numbered parameters in a string.
But the examples are wrong!

Now there is:
printf($translate->_("Today is the %1\$s") . "\n", date('d.m.Y'));

The right example should be without the "\" in "%1\$s" :
printf($translate->_("Today is the %1$s") . "\n", date('d.m.Y'));

Activity

Hide
Thomas Weidner added a comment -

Closing as non-issue.

Please read the PHP manual about printf/sprintf before stating that their syntax is wrong.

Your change would return 'Today is the ' and throw an warning about $s not being declared.

Show
Thomas Weidner added a comment - Closing as non-issue. Please read the PHP manual about printf/sprintf before stating that their syntax is wrong. Your change would return 'Today is the ' and throw an warning about $s not being declared.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: