Zend_Markup レンダラーZend_Markup には現在ひとつのレンダラー、 HTML レンダラーが同梱されています。 自作のマークアップを追加自作のマークアップを追加することによって、Zend_Markup レンダラーに 自作の機能の追加できます。 マークアップ構造とともに、 あなたが望むいかなる機能も追加ができます。 簡潔なマークアップから複雑なマークアップ構造まで。 'foo' マークアップでの単純な例:
あなたの作成したマークアップは、あなたのパーサーがマークアップ構造もサポートするときに 機能することに注意してください。現在、 BBCode はこれをサポートします。 Textile はカスタムマークアップをサポートしません。 Some renderers (like the HTML renderer) also have support for a 'markup' parameter. This replaces the 'start' and 'end' parameters, and it renders the markups including some default attributes and the closing markup. Add a callback markupBy adding a callback markup, you can do a lot more then just a simple replace of the markups. For instance, you can change the contents, use the parameters to influence the output etc. A callback is a class that implements the Zend_Markup_Renderer_TokenInterface interface. An example of a callback class:
Now you can add the 'upper' markup, with as callback, an instance of the My_Markup_Renderer_Html_Upper class. A simple example:
マークアップ一覧
|