Template directive: while

The @while(): operator directive is part of the conditional loop operator directives. It is being used to loop through a list of item.
while:
Example: while:
   @php: $i = 1; @php; // declare $i value
   
   @while($i < 3):
   
   The current number is {{ $i }} <br>
    
   {{: $i++; }}
     
   @endwhile;
                
The response returned above will be
   The current number is 1 
   The current number is 2 
                   
Rather than the @php:, we can similarly use the new smart php directive
   {{: $i = 1; }} // declare $i value
  
   @while($i < 3):
   
   The current number is {{ $i }} <br>
    
   {{: $i++; }}
     
   @endwhile;