Class Capture
Capture part of php code for later use.
This is intended for parts of code which should be evaluated,
for instance for HTML widgets.
Just after evluation or later, executing code can be captured and
displayed on HTML page.
Example:
Capture::open();
echo 'Hi World!';
Capture::close();
Above coge is executed, moreover php code is now available in Capture
class,
and can be salvaged by get
:
echo Capute::get();
Methods summary
public static
|
#
open( integer|string $id = null )
Open PHP capturing block
Parameters
|
public static
Maslosoft\Zamm\Helpers\Wrapper
|
#
close( )
Close php capturing block and get it wrapped
Close php capturing block and get it wrapped
Returns
|
public static
Maslosoft\Zamm\Helpers\Wrapper
|
#
get( integer|string $id = null )
Get last snipped or choosen by id.
Get last snipped or choosen by id.
Parameters
Returns
|
public static
|
#
getMd( integer|string $id = null )
Get captured PHP block, additionally wrapped by markdown
fenced PHP code mark. This can be directly outputted to md file.
Get captured PHP block, additionally wrapped by markdown
fenced PHP code mark. This can be directly outputted to md file.
Deprecated
use Wrapper instead: append ->md
Parameters
|
public static
|
#
getHtml( integer|string $id = null )
Get captured PHP block, additionally wrapped by html pre and code tags.
This can be directly outputted to HTML file.
Get captured PHP block, additionally wrapped by html pre and code tags.
This can be directly outputted to HTML file.
Deprecated
use Wrapper instead: append ->html
Parameters
|