Welcome Guest, Not a member yet? Register   Sign In
Bbcode support in helper
#1

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='www.codeigniter.com'>Codeigniter</a>
image tag [img]www.codeigniter.com/logo.jpg[/img] return <img src="www.codeigniter.com/logo.jpg">

please add this helper feature soon.
Reply
#2

What exactly are you requesting?
Reply
#3

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.
Reply
#4

I handle BBCodes via JS, not via PHP.

Take a look at http://github.com/patorjk/Extendible-BBCode-Parser

It is easy to setup, easy to extend and easy to use.
Reply
#5

Try Parsedown: https://github.com/erusev/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();

echo 
$Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p> 
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB