BBcode parser

Hello, I need to write a bbcode parser. Ok, no problem.

But how can I do this in best Yii way?

I suppose I’ll use the parser directly in the rules of the model, through a (my) function in the filter.

Would it be easier to use an existing parser? I’ve had success integrating the Recruiting Parser into my Yii application (I use it at the controller level, though it would probably be more correct to put use it at the model level, like you said).

Ok, it is a possibility, thanks.

but if I want (for exercise, maybe) follow the philosophy of Yii and integrate it, how should I do?

Look at the existing code highlighter -> markdown parser.

It’s in yii/framework/utils. ;)

Very good, thanks :)

Should I create a class to put in protected/components, right?

I’d do that :)

Then you could put the BBCode parser in a ‘vendors’ directory - either the existing application.vendors or in a subdirectory of application.components.

Or, slightly cleaner perhaps: in application.components.yiibbcode.vendors.