PHPackages                             jolicode/jolitypo-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jolicode/jolitypo-bundle

Abandoned → [jolicode/jolitypo](/?search=jolicode%2Fjolitypo)ArchivedSymfony-bundle

jolicode/jolitypo-bundle
========================

JoliTypo integration for your Symfony2 project

1.0(9y ago)1331.9k1[1 issues](https://github.com/jolicode/JoliTypoBundle/issues)MITPHPPHP &gt;=5.3.2

Since Oct 23Pushed 7y ago4 watchersCompare

[ Source](https://github.com/jolicode/JoliTypoBundle)[ Packagist](https://packagist.org/packages/jolicode/jolitypo-bundle)[ Docs](https://github.com/jolicode/JoliTypoBundle)[ RSS](/packages/jolicode-jolitypo-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

**DEPRECATED**: Since 1.0.3, JoliTypo provides built-in support for Symfony and Twig.

This bundle integrate the [JoliTypo](https://github.com/jolicode/JoliTypo) library into Symfony2.

Configuration
=============

[](#configuration)

Add the Bundle to your Kernel:

```
  new Joli\TypoBundle\JoliTypoBundle(),
```

Define your Fixers preset as you want:

```
joli_typo:
    presets:
        fr:
            fixers: [ Ellipsis, Dimension, Dash, FrenchQuotes, FrenchNoBreakSpace, CurlyQuote, Trademark ]
            locale: fr_FR
        en:
            fixers: [ Ellipsis, Dimension, Dash, EnglishQuotes, CurlyQuote, Trademark ]
            locale: en_GB
```

Please refer to the [JoliTypo documentation](https://github.com/jolicode/JoliTypo/blob/master/README.md) to learn more about fixers, and how to combine them.

**Note:** there is no cache involved with JoliTypo, take care of it if you want to save some CPU cycles 😬

Twig function
=============

[](#twig-function)

The Bundle expose a new Twig function and filter named `jolitypo`, waiting for two arguments: HTML content to fix and the preset name.

```
{{ jolitypo('Hi folk!', 'fr') | raw }}

{# or #}

{{ 'Hi folk!' | jolitypo('fr') }}
```

Another way to use it is by passing a whole block to it:

```
{% block content %}
    {{ jolitypo(block('real_content'), 'fr') | raw }}
{% endblock %}

{% block real_content %}
    My whole dynamic page
{% endblock %}
```

PHP Template helper
===================

[](#php-template-helper)

A `jolitypo` helper is available in the view, exposing a `fix` method:

```
