deblan.tv/src/Deblan/Bundle/BlogBundle/Model/TinyPost.php
2015-03-02 21:57:49 +01:00

21 lines
426 B
PHP

<?php
namespace Deblan\Bundle\BlogBundle\Model;
use Deblan\Bundle\BlogBundle\Model\om\BaseTinyPost;
class TinyPost extends BaseTinyPost
{
public function getExcerpt()
{
$content = strip_tags($this->getContent());
$size = 300;
if (mb_strlen($content, "utf-8") > $size - 3) {
return mb_substr($content, 0, $size, "utf-8") . '&hellip;';
}
return $content;
}
}