kix/mdash-bundle
Composer 安装命令:
composer require kix/mdash-bundle
包简介
E. Muravjov's typographer for Symfony
README 文档
README
This is a Symfony 2 bundle for E. Muravjov's typograph.
Installation is simple. Just drop this line into your composer.json's require section:
"kix/mdash-bundle": "0.5.x"
Add the bundle into your AppKernel.php:
<?php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
// ...
new \Kix\MdashBundle\KixMdashBundle(),
);
After installing, a new mdash Twig filter will be available in your templates. It should be used as follows (let's
assume that article object's text property contains text that needs proper formatting):
{{ article.text | mdash }}
Also, there's a kix_mdash.typographer service available that's an instance of \EMT\EMTypograph. You can always
request it from the container and use it in any way you like:
<?php
class SomeClass implements ContainerAwareInterface
{
public function processText()
{
/** @var \EMT\EMTypograph $typographer */
$typographer = $this->container->get('kix_mdash.typographer');
}
}
Stats
统计信息
- 总下载量: 39
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-06-03