PHP-Decoda integration in Symfony2
A lightweight lexical string parser for BBCode styled markup.
With submodule: git submodule add git://github.com/milesj/php-decoda.git vendor/php-decoda
With clone: git clone git://github.com/milesj/php-decoda.git vendor/php-decoda
Using the vendors script
Add the following lines in your deps
file::
[php-decoda]
git=http://github.com/milesj/php-decoda.git
Run the vendors script::
./bin/vendors install
// app/autoload.php
$loader->registerPrefixes(array(
...
'Decoda' => __DIR__.'/../vendor/php-decoda/decoda',
));
With submodule: git submodule add git://github.com/helios-ag/FMBbCodeBundle.git bundles/FM/BbCodeBundle
With clone: git clone git://github.com/helios-ag/FMBbCodeBundle bundles/FM/BbCodeBundle
Using the vendors script
Add the following lines in your deps
file::
[php-decoda]
git=http://github.com/milesj/php-decoda.git
Run the vendors script::
./bin/vendors install
// app/autoload.php
$loader->registerNamespaces(array(
...
'FM' => __DIR__.'/../vendor/bundles',
// your other namespaces
));
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new FM\BbCodeBundle\FMBbCodeBundle(),
// ...
);
}
this is mandatory parameters:
fm_bb_code: locale: ru-ru
By default only "default" filter enabled, which provide support
for [b], [i], [u], [s], [sub], [sup] BBCodes
{{'[b]Bold text[/b]'|BBCode}}<br />
{{'[u]Underlined text[/u]'|BBCode}}<br />
{{'[i]Italic text[/i]'|BBCode}}<br />
After enabling "quote" filter, you can do such things:
{{'[quote="helios"]My quote[/quote]'|BBCode}}<br />
fm_bb_code:
# language code or 'default' to set it from the session
locale: ru-ru
xhtml: true
filters:
default: enabled
block: enabled
code: enabled
email: enabled
image: enabled
list: enabled
quote: enabled
text: enabled
url: enabled
video: enabled
Add support of whitelist tags and hooks.