![]() |
|
alBBCodeParserPlugin - 0.1.2Maxime Vanmeerbeck |
|
Based on the PECL extension BBCode http://php.net/manual/en/book.bbcode.php, this plugin adds an escaping method ESC_BBCODE that parses your content and replaces bbcode by html. You define all the bbcode tags you need in a settings file. Thanks to the PECL extension, the plugin is really light, only one helper and a settings file.
Install the plugin
$ symfony plugin:install alBBCodeParserPlugin
(or download and unzip in your /plugins directory or checkout with SVN)
Clear your cache
$ symfony cc
The plugins comes with a configuration file:
config/settings.ymlThis is the default configuration that defines all the tags parsed. You can modify or add more by copying this file in your /lib/config (at any stage).
In a view :
// Load the helper <?php use_helper("Parsing"); ?> // indexSuccess.php $object->getContent(ESC_BBCODE); $sf_data->get("var", ESC_BBCODE);
To add your own tags : BBCode PECL extension simply uses an array as paramaters http://www.php.net/manual/en/function.bbcode-create.php The plugin transforms the bbcode yml in the settings in an array for bbcode_create. All you have to do is copying the settings.yml and add your tags.
>First release
This plugin is sponsored by Alcyonis