1. Go to this page and download the library: Download jdz/monitor 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/ */
jdz / monitor example snippets
use JDZ\Monitor\Monitor;
$monitor = new Monitor();
$monitor->h1('Process Report');
$monitor->p('Process completed successfully.');
$monitor->p('42 items processed', 'Total');
echo (string)$monitor;
$monitor->h1('Title'); // <h1>
$monitor->h2('Subtitle'); // <h2>
// ... up to h6()
// Simple paragraph
$monitor->p('Some text');
// With a bold label prefix
$monitor->p('150ms', 'Duration');
// Output: <p><strong>Duration</strong>: 150ms</p>
// With inline style
$monitor->p('All good', 'Status', 'color:green;');
$monitor->list([
'Step 1: Data fetched',
'Step 2: Data validated',
'Step 3: Data imported',
]);
// String (newlines are converted to <br />)
$monitor->pre("line 1\nline 2");
// Or an array of lines
$monitor->pre(['line 1', 'line 2']);