Skip to content

PowerParser Directive: :while#

This is equivalent to PHP while loops.

Syntax#

:while(condition)
<!--HTML or Other PowerParser Directive-->
:endwhile

Example#

<ul>
    !{{ $i = 1 }}!
    :while($i <= 5)
    <li>Page {{ $i }}</li>
    !{{ $i++ }}!
    :endwhile
</ul>

This will output:

  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Page 5
Back to top