Download the PHP package helios-ag/fm-bbcode-bundle without Composer
On this page you can find all versions of the php package helios-ag/fm-bbcode-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download helios-ag/fm-bbcode-bundle
More information about helios-ag/fm-bbcode-bundle
Files in helios-ag/fm-bbcode-bundle
Package fm-bbcode-bundle
Short Description Symfony FMBbCodeBundle
License MIT
Homepage https://github.com/helios-ag/FMBbCodeBundle
Informations about the package fm-bbcode-bundle
FMBBCodeBundle
PHP-Decoda integration in Symfony2
A lightweight lexical string parser for BBCode styled markup.
Contributors
- Alexandre Quercia alquerci
- Gaiffe Antoine toinouu
- Luis Íñiguez idetia
- Sebastian slider
- olleyyy
- Dirk Olbertz dolbertz
- Florian Krauthan fkrauthan
- predakanga
- Dan piratadelfuturo
Code Quality Assurance
SLInsight | Travis CI | Gitter | Coverage | StyleCI |
---|---|---|---|---|
Deps Status | Version | Downloads |
---|---|---|
Installation
To install this bundle, you'll need both the Decoda library and this bundle. Installation depends on how your project is setup:
Step 1: Installation
Using Composer, just add the following configuration to your composer.json
:
Or you can use composer to install this bundle:
For symfony <3.0, use latest ~6 version
for Symfony 3
or
Step 2: Enable the bundle
Finally, enable the bundle in the kernel:
Step 3: Dump emoticons (optional)
To enable emoticons via emoticon hook, use the following command to copy emoticons images to public folder (web/emoticons)
Basic configuration
Make the Twig extensions available by updating your configuration:
By default only "default" filter enabled, which provide support
for [b], [i], [u], [s], [sub], [sup], [abbr], [br], [hr], [time]
BBCodes
Examples to use the extension in your Twig template
Define BBCode filter in your config.yml:
And you can do the following:
After enabling "quote" filter, you can do such things:
Also you can define multiple filter sets under filter_sets parameter like this:
Please keep in mind, that whitelist tags suppress tags, that applied by filters configuration.
Strip filter
To clear text from any bbcodes use bbcode_clean filter: example:
This filter will eliminate any known to decoda tags
Escaping and line breaks
Escaping and line breaks can be controlled via "escaping" and "line_breaks" parameters under filter configuration. Default configuration for them is 'true'. If you wish to pipeline filters, set escaping to false.
Advanced configuration
Overriding messages
Some templates and hooks, use text strings, that can be translated into different languages, the original file located under decoda/config directory, but content of this file can be overriden with messages option, under messages: node. File should be json formatted.
Adding own templates
Your own templates can be defined at templates node, the example below shows how:
Template examples can be found inside decoda library
Adding own filter
To enable a custom filter, add it as a regular service in one of your configuration, and tag it with fm_bbcode.decoda.filter
:
Your service must implement the Decoda\Filter
interface.
If your service is created by a factory, you MUST correctly set the class parameter for this tag to work correctly.
Adding own hook
To enable a custom hook, add it as a regular service in one of your configuration, and tag it with fm_bbcode.decoda.hook
:
Your service must implement the Decoda\Hook
interface.
If your service is created by a factory, you MUST correctly set the class parameter for this tag to work correctly.
Then enable it in your configuration:
Customize your own emoticons
Your own emoticons can be defined at emoticon
node, the example below shows how:
How to automatically dump emoticons on each deploy
Add the following commands to you projects composer.json:
To customize emoticons assets folders, use path
and folder
node configuration:
All versions of fm-bbcode-bundle with dependencies
mjohnson/decoda Version 6.*
symfony/twig-bundle Version ~3.0
symfony/assetic-bundle Version ~2.4
symfony/config Version ~3.0
symfony/console Version ~3.0
symfony/dependency-injection Version ~3.0
symfony/framework-bundle Version ~3.0
symfony/http-foundation Version ~3.0
symfony/http-kernel Version ~3.0
symfony/process Version ~3.0
symfony/templating Version ~3.0
symfony/yaml Version ~3.0
sensio/distribution-bundle Version ~5.0