CodeIgniter Forums

Full Version: Bbcode support in helper
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In codeigniter add a new helper call bbcode. It takes a string and return html tags.
You can do it with php build in function preg_replace()
like bbcode.
example :
line break return a <br> tag.
dobule line break return <p> tag with close tag also.
link tag Codeigniter return <a href=''>Codeigniter</a>
image tag [img][/img] return <img src="">

please add this helper feature soon.
What exactly are you requesting?
This is not something that will be in core. There are always third party libraries you can install directly, and PHP even has an extension you can compile in if you need it.
I handle BBCodes via JS, not via PHP.

Take a look at

It is easy to setup, easy to extend and easy to use.
Try Parsedown:

It's not for BBCodes, it's for Markdown, but the syntax is even easier. The code is super easy to use:

PHP Code:
$Parsedown = new Parsedown();

$Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>