From: Andreas A. <a.a...@th...> - 2001-09-22 13:32:18
|
Hi Alex, I just played around using classes as tag-compiler. Now I've worked out the following structure (note some renaming): - BCTagParser renamed to Bcc ("Binarycloud-Compiler") - compiler classes named: BccModuleCompiler BccImageCompiler ... we should consider to make a package to place the stuff in e.g. base/mod/bcc/ Compiler classes follow the rules of modules. (constructor, output). Output must return the string that contains the compiled tag, 'false' in case of error (strict validation is done, so it _must_ be exactly FALSE). The tagdata that should be compiled by the Bcc*Compiler-class is passed to the constructor, just like $_params within modules. So the classes can also be used in a page context as module. Im not quite sure if we should make the Bcc object global. If so, the user can register the tags automatically to Bcc by just importing the compiler classes. i.e. -- snipp -- <? class BccModuleCompiler() { function BccModuleCompiler($_params) {} function Output() {} } global $Bcc; $Bcc->RegisterTag("BC:MODULE", "BccModuleCompiler"); ?> -- snipp -- What do you think of this? Andi |