1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Patron;
13
14 function tr($str, $from, $to)
15 {
16 return strtr($str, $from, $to);
17 }
18
19 20 21 22 23 24
25 function render($template, $thisArg=null, array $options=array())
26 {
27 static $engine;
28
29 if (!$engine)
30 {
31 $engine = new Engine;
32 }
33
34
35 }
36
37
38 function by_columns(array $array, $columns, $pad=false)
39 {
40 $values_by_columns = ceil(count($array) / $columns);
41
42 $i = 0;
43 $by_columns = array();
44
45 foreach ($array as $value)
46 {
47 $by_columns[$i++ % $values_by_columns][] = $value;
48 }
49
50 return $by_columns;
51 }