Skip to content

Instantly share code, notes, and snippets.

@peschmae
Created September 25, 2012 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peschmae/3781226 to your computer and use it in GitHub Desktop.
Save peschmae/3781226 to your computer and use it in GitHub Desktop.
inline printf ViewHelper
<f:format.printf arguments="{number: '{singleDigitToDisplayWithLeadingZero}'}">%1$02d</f:format.printf>
How can that be written inline?
Possible Workaround (Ugly, since we need to set the format in the controller)
Controller:
<?php
$this->view->assign('monthFormat', '%1$02d');
?>
View:
{monthFormat-> f:format.printf(arguments: {1:'{singleDigitToDisplayWithLeadingZero}'})}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment