Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuel Text Filter Package
  • I just released a Text Filter package for Fuel. Its purpose is to add a way to run filters on text input in a unified way. I originally made the package to run on Response output, but think it's much better served to not limit itself to that. http://github.com/ninjarite/fuel-textfilter The package needs a bit of documentation, but here are the basics... add the package as normal, either at runtime or in always_load To create a set of filters to be run at once...
    // In one command
    $output = FilterSet::factory('label', array('acronym', 'markdown')->process_all($string_to_parse);
    
    // As an object
    $filterset = FilterSet::factory('label');
    $filterset->prepend('acronym', $config_array);
    $flterset->append('markdown');
    
    $markdown_output = $filterset->process('markdown');
    $acronym_output = $filterset->process('acronym');
    
    $all_output = $filterset->process_all();
    
    $filterset->reset()
    
    var_dump($filterset); // Will show that all filters have been erased.
    

    You may have multiple instances of filterset, and I am working on a way to store filtersets so you can use them on multiple requests. To directly access a single filter...
    $filter = new Filter('markdown', $config_array);
    $filtered_output = $filter->process($string_to_be_formatted);
    
    // Or in one call
    $filtered_output = new Filter('acronym')->process($string_to_be_formatted);
    
  • There are more pre-packaged filters on the way as I think of them. Any suggestions?
  • Hats off to you mate you are getting good at this :) Just been chatting with Dregond on x-chat he has a few good ideas for packages / modules. He was talking about some sort of CRUD package which I thought was a good idea. You should get on there as lots of good discussions pop up.
  • I have my baby boy today so I won't have time but if you have any good ideas send them my way!!!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion