> 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/
yes.
> 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
Well, remember that this all happens at make-time, so I'm a _lot_ less
worried about a clean global space.
I see no reason not to make $Bcc global for convenience.
This looks fantastic, by the way :)
best,
_alex
|