1. Go to this page and download the library: Download yohns/legal-pages 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/ */
yohns / legal-pages example snippets
Yohns\Gens\Legal\LegalPageGenerator;
$gen = new LegalPageGenerator('privacy-policy', 'ecommerce', [
'company' => ['name' => 'Acme Inc', 'email' => '[email protected]'],
'website' => ['url' => 'https://acme.com', 'name' => 'Acme Store'],
]);
// Get raw Markdown
$markdown = $gen->generate();
// Get Bootstrap 5.3.8 HTML fragment (for embedding in your page)
$fragment = $gen->convertToHtml();
// Get full standalone HTML page with Bootstrap CDN
$fullPage = $gen->convertToHtml(full: true);
// Save to file
$gen->savePage($fullPage, 'privacy-policy.html', __DIR__ . '/generated');
$gen->savePage($markdown, 'privacy-policy.md', __DIR__ . '/generated');
// Personal blog
$gen = new LegalPageGenerator('privacy-policy', 'personal', $config);
// Online store
$gen = new LegalPageGenerator('privacy-policy', 'ecommerce', $config);
// Social network
$gen = new LegalPageGenerator('privacy-policy', 'social', $config);
Yohns\Gens\Legal\LegalPageGenerator;
$config = sonal', $config);
// Get content as variables — no files written
$markdown = $gen->generate();
$html = $gen->convertToHtml(full: true);
// Use $html in your own layout
echo "<main class='legal-content'>$html</main>";