It would be really nice to add a truncate method to the formatter helper or similar. Which does the following:
public function truncate($text, $length, $suffix = '...')
{
$computedLength = $length - strlen($suffix);
return strlen($text) > $computedLength ? substr($text, 0, $computedLength) : $text;
}
This is a recurrent requirement and would be especially useful when combined with the Table class.