Truncate links with CakePHP
How can I truncate links through the Html Helper in CakePHP?
the book only truncates text strings, but how the truncate a link li开发者_如何学Pythonke this?
$this->Html->link('This is a very long link that needs to be truncated', '/pages/home', array('class' => 'button', 'target' => '_blank'));
Thanks
Combine usage with the TextHelper::truncate method. Example:
$this->Html->link(
$this->Text->truncate('This is a very long link that needs to be truncated'),
'/pages/home',
array('class' => 'button', 'target' => '_blank')
);
精彩评论