git.cweiske.de
/
phinde.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove multiple tags
[phinde.git]
/
www
/
www-header.php
diff --git
a/www/www-header.php
b/www/www-header.php
index 60adacf2c5109051a002f005d992ae46b8be9710..2ec8c2fffcc876e464247031af340f88ab0aeb9c 100644
(file)
--- a/
www/www-header.php
+++ b/
www/www-header.php
@@
-12,6
+12,14
@@
$GLOBALS['twig'] = new \Twig_Environment(
);
$GLOBALS['twig']->addExtension(new \Twig_Extension_Debug());
);
$GLOBALS['twig']->addExtension(new \Twig_Extension_Debug());
+$twig->addFunction('ellipsis', new \Twig_Function_Function('\phinde\ellipsis'));
+function ellipsis($text, $maxlength)
+{
+ if (strlen($text) > $maxlength) {
+ $text = substr($text, 0, $maxlength - 1) . '…';
+ }
+ return $text;
+}
function render($tplname, $vars = array(), $return = false)
{
function render($tplname, $vars = array(), $return = false)
{