Issues

ZF-12107: Zend_Filter_CharConverter

Issue Type: New Feature Created: 2012-03-20T00:03:49.000+0000 Last Updated: 2012-03-22T00:19:48.000+0000 Status: Open Fix version(s): Reporter: Bruno Thiago Leite Agutoli (btlagutoli) Assignee: Thomas Weidner (thomas) Tags: -

Related issues: Attachments:

Description

Hello, recently I made a filter called "CharConverter" doing a job of converting special characters to another similar character.

Below is an example of implementation;

h3. Examples

<pre class="highlight">
$filter1 = new Zag_Filter_CharConvert(array( 
    'replaceWhiteSpace' => '-', 
    'locale' => 'en_US', 
    'charset'=> 'UTF-8' 
)); 

echo $filter1->filter('ééé ááá 90');//eee-aaa-90 
echo $filter1->filter('óóó 10aáééé');//ooo-10aaeee 



<pre class="highlight">

$filter2 = new Zag_Filter_CharConvert('UTF-8', 'en_US', '-'); 
echo $filter2->filter('éééé ááááá 90');//eeee-aaaaa-90



<pre class="highlight">

$filter3 = new Zag_Filter_CharConvert(); 
echo $filter3->filter('éééé ááááá 90');//eeee aaaaa 90 

With this filter is very easy to convert text into friendly url for example.

well, that's it, I do not know if this is in accordance with the Zend but if you would like to help in the development.

Note: The plugin was not implemented with namespaces (Zend\Filter), they still did it to version 1.11.10, but I can adapt easily to the ZF2

thanks!

Comments

Posted by Frank Brückner (frosch) on 2012-03-20T08:35:36.000+0000

Code tags added.

Posted by Frank Brückner (frosch) on 2012-03-20T08:38:55.000+0000

Hi Bruno, nice idea! :-)

Do you have a Github account or something similar, where we can see the code?

Includes your code unit tests?

Posted by Bruno Thiago Leite Agutoli (btlagutoli) on 2012-03-22T00:19:48.000+0000

Hi, I climbed up the project in "github" https://github.com/agutoli/…

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts