PHP Classes


Recommend this page to a friend!
  Classes of Alexey Dodonov   Mezon PHP HTML Report Builder   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Mezon PHP HTML Report Builder
Generate HTML to compose reports
Author: By
Last change:
Date: 1 year ago
Size: 1,600 bytes


Class file image Download

Mezon HTML report generator

Pros and cons

Mezon HTML report generator allows you to create reports in a simple and pretty way. This tool also shortens time wich you spend on coding.

This package is a part of Mezon Framework


Just type:

composer require mezon/html-report


Lets start from creating object of the report generator:

$report = new Html();

And since that moment we can add elements to the head or body:

// 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');;


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

More complex examples

This example shows that every call creates new tag (except html and body). So if you want to add multyple tags then you need to store tag into variable:

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




Supported tags

For now you can use following tags:

  • body
  • div
  • h1
  • h2
  • h3
  • h4
  • h5
  • head
  • p
  • strong
  • style
  • table
  • td
  • tr

Inner HTML

If you need more tags, you can use innerHtml like in the example below: