pluf2

pluf2 Commit Details


Date:2010-09-15 08:32:44 (14 years 3 months ago)
Author:Mehdi Kabab
Branch:master
Commit:bfeca2aa27989847e96c81a0822439b619fa415b
Parents: 5f8c062e6f8a6ce603020274749de5246e815a33
Message:Added the following template filters: first, last, sha1, ltrim and rtrim.

Changes:

File differences

src/Pluf/Template.php
301301
302302
303303
304
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
$email = chunk_split(bin2hex($email), 2, '%');
$email = '%'.substr($email, 0, strlen($email) - 1);
return Pluf_Template::markSafe($email);
}
}
/**
* Returns the first item in the given array.
*
* @param array $array
* @return mixed An empty string if $array is not an array.
*/
function Pluf_Template_first($array)
{
$array = (array) $array;
$result = array_shift($array);
if (null === $result) {
return '';
}
return $result;
}
/**
* Returns the last item in the given array.
*
* @param array $array
* @return mixed An empty string if $array is not an array.
*/
function Pluf_Template_last($array)
{
$array = (array) $array;
$result = array_pop($array);
if (null === $result) {
return '';
}
return $result;
}
src/Pluf/Template/Compiler.php
8989
9090
9191
92
9293
9394
9495
......
9899
99100
100101
101
102102
103103
104
105
104106
105107
106108
......
108110
109111
110112
113
114
111115
112116
113117
......
673677
674678
675679
676
'lower' => 'strtolower',
'count' => 'count',
'md5' => 'md5',
'sha1' => 'sha1',
'escxml' => 'htmlspecialchars',
'escape' => 'Pluf_Template_htmlspecialchars',
'strip_tags' => 'strip_tags',
'debug' => 'print_r',
'dump' => 'Pluf_Template_varExport',
'fulldebug' => 'var_export',
'count' => 'count',
'nl2br' => 'Pluf_Template_nl2br',
'trim' => 'trim',
'ltrim' => 'ltrim',
'rtrim' => 'rtrim',
'unsafe' => 'Pluf_Template_unsafe',
'safe' => 'Pluf_Template_unsafe',
'date' => 'Pluf_Template_dateFormat',
'dateago' => 'Pluf_Template_dateAgo',
'timeago' => 'Pluf_Template_timeAgo',
'email' => 'Pluf_Template_safeEmail',
'first' => 'Pluf_Template_first',
'last' => 'Pluf_Template_last',
);
/**
}
}
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06283s using 13 queries.