Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

README.md

VRiaNoDiacriticBundle

Build Status

The symfony integration for nodiacritic library - tiny library that removes all diacritical signs from characters.

##Installation

Using Composer, run:

composer require vria/nodiacritic-bundle

Add the VRiaNoDiacriticBundle to your application kernel:

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new VRia\Bundle\NoDiacriticBundle\VRiaNoDiacriticBundle(),
        // ...
    );
}

##Use

In controller:

$noDiacriticString = NoDiacritic::filter("Révolution française");

In Twig template:

{{ "Révolution française"|nodiacritic }}

As expected, the result is Revolution francaise.

As you can see nodiacritic library is aware of German and Danish particularities, and so is this integration. The bunble reads current locale from Request and pass it to filter function. In case the desired locale is different you can pass it as a parameter:

Ceci est une phrase allemande sans caractères spéciaux: {{ "Schöne straße"|nodiacritic("de") }}

will print Ceci est une phrase allemande sans caractères spéciaux: Schoene strasse.

You can find the article about the library in my blog.

About

The symfony integration for nodiacritic library

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.