FreeMarkerテンプレートエンジン【Velocityよりずっとまし】at PHPFreeMarkerテンプレートエンジン【Velocityよりずっとまし】 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト24:FreeMarker vs. Velocity 05/07/14 03:11:15 [ Advanced rendering control ] * You can enclose a block of template in a set of tags that will cause it to apply HTML escaping or XML escaping (or any other transformation you can express as a FreeMarker expression for that matter) on all interpolations (${foo}) in the block. * FreeMarker has transforms, which are blocks of template that when rendered, go through a transforming filter. Built-in transforms include whitespace compressor, HTML and XML escaper. Best of all, you can implement your own transformers as well (i.e. if you generate Java source code, you can write a Java code pretty-printer transform and insert it into the template). Naturally, transforms can be nested. * You can explicitly flush the output writer with a built-in flush-directive. * You can stop the rendering with a built-in stop-directive. [ 高度なレンダリングコントロール ] * テンプレート中のあるブロックをタグで囲んで範囲指定し、その中に含まれるすべての Interporation(${foo})に対してHTMLエスケープやXMLエスケープ(あるいはFreeMarkerの 式として表現できる、ほかのどんなTransformation)の対象とすることができます。 * FreeMarkerはTtransformという機能があります。これは、テンプレート中のブロックを レンダリングされるときに変換フィルターを通す機能です。 組み込み済みのTransformとしては、連続するホワイトスペースを圧縮したり、 HTMLやXMLの特殊文字をエスケープしたりするものがあります。 また独自の変換を作成することもできます(例えばJavaのソースコードを生成したときに、 そのコードをきれいにフォーマットして出力するようなTransformを作成することができます)。 当然ですが、Transformはネストさせることができます。 * 組み込みのflushディレクティブを使って、出力用writerを明示的にフラッシュすることができます。 * 組み込みのstopディレクティブを使って、レンダリングを止めることができます。 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch