happyr/excerpt-bundle
Composer 安装命令:
composer require happyr/excerpt-bundle
包简介
A Symfony2 Bundle to make excerpts
README 文档
README
The purpose of this is to try Hack programming language. This is not the fastest or the most elegant way of programming. But it is a good bundle to show in a demo. I wrote a blog post about this bundle on developer.happyr.com.
The Excerpt Bundle takes an excerpt from a HTML string. We make sure to return valid HTML and we do not break words.
Installation
- Install with composer:
composer require happyr/excerpt-bundle
- Enable the bundle:
// app/AppKernel.php public function registerBundles() { $bundles = [ // ... new HappyR\ExcerptBundle\HappyRExcerptBundle(), ]; }
Using the Twig filter
{{ '<p>Hello World Foobar!</p>'|excerpt(17) }}
{# <p>Hello World...</p> #}
Default Configuration
happy_r_excerpt: tail: '...' length: 300
统计信息
- 总下载量: 441
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-05-10