FAQ

Truncate Text

You can truncate text







# 1 > Truncate
<?= $this->Text->truncate('Title goes here', 200, array('ellipsis' => '...',
    'exact' => true,
    'html' => false)); ?>

 





# 2 > With a Cakephp link and tooltip

This is a common practice when you want to truncate a link but have a nice bootstrap full version as you roll-over

<?= $this->Html->link($this->Text->truncate($project['Project']['name'], 20), array(
'client' => true, 'controller' => 'Projects', 'action' => 'detail', $project['Project']['id']
), array(
'title' => $project['Project']['name'],
'data-toggle' => 'tooltip',
'data-html' => 'true'
)); ?>