Capture Output

Capture Outputs as Variable

By wrapping your code with the capture object syntax, you create an output buffer that stores the output in a variable rather than sending it to be displayed. Once the variable is stored into the variable, the internal buffer clears automatically.

{?>
    ::h1 "Header One"
<?}
$variable = $_;

$variable
#=> '<h1 style="margin-top: 0px;">Header One</h1>'

Capture Object Snippet

Type an underscore (_) and then click on the item labeled "Capture Ob Start and End," which will create the empty Capture Object structure for you.

{?>

<?}
$_ = $_;
Copyright © SunSed LLC 2013-2021 All rights reserved.