Link | output_capture |
Author | Mark Kawakami |
Category | Output |
Version | 8.x |
License | Public Domain |
Posted | 13 Feb 2006 |
Updated | 02 Mar 2006 |
More by this author... |
The basic method to get custom tags to output text and html is to build a string that returns your desired output, which works fine for small to medium chunks of code, but can be a pain for longer and more complex output. The purpose of this code is to take the output that would ordinarily be generated by a block of Lasso code and capture it to a variable, rather than outputting it directly to the page (or discarding it as is the case in custom tags). UPDATE: According to the comments, this may require Lasso 8.1 or higher
[var('ret') = ''] [output_capture($ret)]My name is [if(action_param('network') == 'FOX')]Judge[else(action_param('network') == 'NBC')]Earl[else]Slim Shady[/if].
[/output_capture] [$ret] now evaluates to:My name is Earl
.
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
// output_capture tag definition define_tag('output_capture', -required='captureTo', -container); local('ret') = run_children; #captureTo = #ret; /define_tag;
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
My bad