Added by Van Belle Jonathan, last edited by Ralph Schindler on Nov 03, 2008  (view change)

Labels

 
(None)

Zend Framework: Zend_Filter_Bbcode Component Proposal

Proposed Component Name Zend_Filter_Bbcode
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Filter_Bbcode
Proposers Van Belle Jonathan
Ralph Schindler, Zend liaison
Revision 1.0 - 22 Augustus 2007 : first proposal (wiki revision: 8)

Table of Contents

1. Overview

Zend_Filter_Bbcode is a component to parse bbcode tags to html syntax.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

4. Dependencies on Other Framework Components

  • Zend_Filter_Interface

5. Theory of Operation

...

6. Milestones / Tasks

  • Milestone 1: [DONE] basic code
  • Milestone 2: add more comments on the code!
  • Milestone 3: Optimisation
  • Milestone 4: unit test

7. Class Index

  • Zend_Filter_Bbcode

8. Use Cases

UC-01

9. Class Skeletons

Replacing BBCodes with regular expressions or simple string replaces is a very bad idea, as it could end in not well-formed HTML/XHTML. In mind of the MVC pattern, this should also be part of a view helper, not of a component in the controller part.

By the way, here you can see a very good implementation of BB-code parsing:

http://www.christian-seiler.de/projekte/php/bbcode/index_en.html

I agree, its a nice one, but its in PHP4 and quite complex to use (it maybe might be easier ). But this shows me one thing: Its not such a good idea to try to replace BBCode with theire html-tags, as you also mentioned, instead of a "parsing process". So it seems to be more useful to implement BBCode as an own component instead of a filter (also mentioned by another proposal (1)), which cant reach the power of something like Seiler's implementation. A filter may access that component.

(1) http://framework.zend.com/wiki/display/ZFPROP/Zend_Filter_Bbcode+-+Pieter+Kokx

I think this needs to be its own component with a view helper. The Zend_Markup approach seems more "correct" in this respect. Perhaps you could work with Pieter Kokx on a joint proposal.