FMBbCodeBundle icon indicating copy to clipboard operation
FMBbCodeBundle copied to clipboard

Disable filters/hooks via config.yml?

Open alexwybraniec opened this issue 9 years ago • 1 comments

I would like to disable the Decoda censor hook via config.yml.

The Decoda docs give this example of: $code = new Decoda\Decoda($string); $code->removeHook('Censor');

but I can't see how this could be done in the FMBbCodeBundle.

My current workaround is to amend the Decoda package to return an empty censorship array, but this has meant editing a composer package directly.

Any help greatly appreciated.

alexwybraniec avatar Jun 21 '16 10:06 alexwybraniec

Hello @alexwybraniec

To achieve your goal you can override the default filter sets that is named _default. You can also use a custom filter set.

The minimalist config can be:

fm_bbcode:
  filter_sets:
    _default:
      filters: [ default ]
    my_default:
      filters: [ default, quote ]

The default settings of the _default filter sets come from Decode::default().

I hope this will help you.

alquerci avatar Jun 21 '16 16:06 alquerci