alBBCodeParserPlugin - 0.1.2

Maxime Vanmeerbeck

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

alBBCodeParserPlugin

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.

Installation

  • Install the plugin

    $ symfony plugin:install alBBCodeParserPlugin
    

(or download and unzip in your /plugins directory or checkout with SVN)

  • Clear your cache

    $ symfony cc
    

Configuration

The plugins comes with a configuration file:

  • config/settings.yml

This 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).

Usage

  • In a view :

    // Load the helper
    <?php use_helper("Parsing"); ?>
    // indexSuccess.php
    $object->getContent(ESC_BBCODE);
    $sf_data->get("var", ESC_BBCODE);

Extend the plugin

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.

Changelog

>First release


This plugin is sponsored by Alcyonis