We have to use the below syntax if we need to truncate the string from .phtml file
<?php $length = 10; ?>
<?php $string = new \Magento\Framework\Stdlib\String;?>
<?php echo $string->substr($data->getContent(),0,$length); ?>
<?php $length = 10; ?>
<?php $string = new \Magento\Framework\Stdlib\String;?>
<?php echo $string->substr($data->getContent(),0,$length); ?>
No comments:
Post a Comment