PHP code example of mezon / html-report

1. Go to this page and download the library: Download mezon/html-report library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mezon / html-report example snippets


$report = new Html();

// not that stylesheets are not validated, it is totally on your side
$report->head()->style()->selector('p')->css('color', 'red');
$report->head()->style()->selector('div')->css('color', 'green');;

$report->body()->p('Hello!');
$report->body()->div('World!');

// here we get HTML code in the variable $result
$result = $report->compile();

$table = $report->table();
$row = $table->tr();

$row->td()->innerHtml('#1');
$row->td()->innerHtml('Legolas');

$row->td()->innerHtml('#2');
$row->td()->innerHtml('Frodo');

$row->td()->innerHtml('#3');
$row->td()->innerHtml('Aragorn');

$report->body()->innerHtml('<script>alert(1);</scrip>');