PHP Classes

File: Library/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test

Recommend this page to a friend!
  Classes of Duong Huynh Nghia   Lego PHP   Library/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test   Download  
File: Library/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/batch.test
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Lego PHP
Blog and shopping cart system
Author: By
Last change:
Date: 7 years ago
Size: 704 bytes
 

Contents

Class file image Download
--TEST-- "batch" filter --TEMPLATE-- {% for row in items|batch(3) %} <div class=row> {% for column in row %} <div class=item>{{ column }}</div> {% endfor %} </div> {% endfor %} --DATA-- return array('items' => array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j')) --EXPECT-- <div class=row> <div class=item>a</div> <div class=item>b</div> <div class=item>c</div> </div> <div class=row> <div class=item>d</div> <div class=item>e</div> <div class=item>f</div> </div> <div class=row> <div class=item>g</div> <div class=item>h</div> <div class=item>i</div> </div> <div class=row> <div class=item>j</div> </div>