On Wed, 2009-09-23 at 09:20 -0700, David E. Wheeler wrote:
> Ah, thanks. Can you show me a piece of code demonstrating what one  
> might want to use it for?

You can use it to manipulate the output from TD tags as they are output.
It's used internally to make the tags nest correctly, and be output to
the right place.  I can't think of many cases where you'd want or need
to frob it by hand, but it does enable things like the following:

template simple => sub {
    html {
        head {}
        body {
            Template::Declare->buffer->set_filter( sub {uc shift} );
            p { 'Whee!' }
            p { 'Hello, world wide web!' }
            Template::Declare->buffer->clear_top if rand() < 0.5;
        }
    }
};

...which outputs, with equal regularity, either:

        <html>
         <head></head>
         <body>
          <P>WHEE!</P>
          <P>HELLO, WORLD WIDE WEB!</P>
         </body>
        </html>

...or:

        <html>
         <head></head>
         <body></body>
        </html>

 - Alex

_______________________________________________
jifty-devel mailing list
jifty-devel@lists.jifty.org
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel

Reply via email to