>     if ( $m->request_args()->{'is_ajax'} )
>     {
>         $m->clear_buffer();    # throw away output to this point
>         _your_code();             # output your content
>         $m->abort();                # finish the request and return
>     }
>     else
>     {
>         _your_code();            # output your content with wrapping
>     }
> 
> Since often you will be using the same code regardless of an 
> ajax call or a vanilla web request, I find this more compact 
> that to replicate code into separate components.
Seems to work nicely, thanks. Did almost the same thing except, in order
to prevent code replication *within* the component I just used 2 if
statements, one before and one after the component block.
% $m->clear_buffer if $is_ajax
<comp content>
% $m->abort if $is_ajax

Thanks all for your help and numerous suggestions (for sure: TIMTOWTDI)!
Regards,
Marc

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to