happyr/slugify-bundle
Composer 安装命令:
composer require happyr/slugify-bundle
包简介
A Symfony2 Bundle to slugify swedish texts
README 文档
README
This bundle provides integration of the URLify library into Symfony2. A slugify service and twig filter is provided. This bundle is a modified version of the ZenstruckSlugifyBundle. The ZenstruckSlugifyBundle uses the Slugify library.
Installation
-
Install with composer:
php composer.phar require happyr/slugify-bundle -
Enable the bundle:
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new HappyR\SlugifyBundle\HappyRSlugifyBundle(), ); }
Using the service
$slugifier = $this->container->get('happyr.slugify.slugifier'); $text = $slugifier->slugify('Hello World!'); echo $text; //prints "hello-world"
Using the Twig filter
{{ 'Hello World!'|slugify }} {# hello-world #}
Full Default Configuration
happy_r_slugify: twig: false #set to true to enable twig filter
统计信息
- 总下载量: 20.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-09-18