I have the following code in a Blade view:
@for ($i = 1; $i <= 99; $i++)
<div id="player-"></div>
@endfor
Which generates divs with ids player-1, player-2, player-3, etc. But what I really need is to have the ids player-01, player-02, player-03, etc. Is there a function in blade to do that like printf in PHP? or using a ternary operator is the best way around?
(The ternary operator works fine when only one zero needs to be added, but doesn't work that fine when more zeros are needed)
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2nM1ocN
via IFTTT
Aucun commentaire:
Enregistrer un commentaire