[jifty-devel] 'smart_tag_wrapper' to make creating smarter tags easier

Jesse Vincent jesse at bestpractical.com
Sun Mar 18 21:58:01 EDT 2007


I needed this tonight. Wanna make it go? ;)
On Mar 16, 2007, at 5:26 AM, Edmund von der Burg wrote:

> Hello,
>
> I've just committed code to Template::Declare that should make it
> easier to create smarter wrappers in the templates - for example the
> 'form' wrapper. Please see the diff for the details.
>
>  http://svn.jifty.org/index.cgi/jifty/revision/?rev=2989
>
> Using this the 'form' sub in J::V::Declare::Helpers would become:
>
> {
>    no warnings qw/redefine/;
>    sub form (&) {
>        my $code = shift;
>
>        smart_tag_wrapper {
>          outs_raw( Jifty->web->form->start(@_) );
>          $code->();
>          outs_raw( Jifty->web->form->end );
>          return '';
>        };
>    }
> }
>
>
> you could then call it like this (not tested properly):
>
> my $action = ...setup_action..;
> with( call => $next, name => "loginbox" ),
>  form {
>    render_action( $action, [qw(nick password remember)] );
>    form_submit( label => 'Login', submit => $action );
>  };
>
> and the form->start will get the call and next arguments.
>
>
> I like it :)
>
>
> If you think this is good then we can add it to the Jifty code. I've
> held off as I don't want to break existing apps and also the version
> of T::D would need bumping and the new version set in Makefile.PL
>
> Have a good weekend.
>
> Cheers,
>  Edmund.
>
>
> -- 
> In reality I'm evdb at ecclestoad.co.uk - http://ecclestoad.co.uk
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.bestpractical.com/pipermail/jifty-devel/attachments/20070318/db9850ba/PGP.pgp


More information about the jifty-devel mailing list