2017 © Pedro Peláez
 

symfony-bundle jolitypo-bundle

JoliTypo integration for your Symfony2 project

image

jolicode/jolitypo-bundle

JoliTypo integration for your Symfony2 project

  • Wednesday, August 10, 2016
  • by damienalexandre
  • Repository
  • 4 Watchers
  • 13 Stars
  • 15,174 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

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

This bundle integrate the JoliTypo library into Symfony2., (*2)

Configuration

Add the Bundle to your Kernel:, (*3)

  new Joli\TypoBundle\JoliTypoBundle(),

Define your Fixers preset as you want:, (*4)

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 to learn more about fixers, and how to combine them., (*5)

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

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., (*7)

{{ jolitypo('

Hi folk!, (*8)

', 'fr') | raw }} {# or #} {{ '

Hi folk!, (*9)

' | jolitypo('fr') }}

Another way to use it is by passing a whole block to it:, (*10)

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

{% block real_content %}


My whole dynamic page

{% endblock %}

PHP Template helper

A jolitypo helper is available in the view, exposing a fix method:, (*11)

<?php echo $view['jolitypo']->fix('<p>Content</p>', 'en'); ?>

Todo

  • Allow to set service as Fixer via an @
  • Use Lazy services for all the presets

The Versions

10/08 2016

dev-master

9999999-dev https://github.com/jolicode/JoliTypoBundle

JoliTypo integration for your Symfony2 project

  Sources   Download

MIT

The Requires

 

typography hyphen smartquote jolitypo

10/08 2016

1.0

1.0.0.0 https://github.com/jolicode/JoliTypoBundle

JoliTypo integration for your Symfony2 project

  Sources   Download

MIT

The Requires

 

typography hyphen smartquote jolitypo

23/10 2015

0.2

0.2.0.0 https://github.com/jolicode/JoliTypoBundle

JoliTypo integration for your Symfony2 project

  Sources   Download

MIT

The Requires

 

typography hyphen smartquote jolitypo