PHP code example of comfyphp / markdown

1. Go to this page and download the library: Download comfyphp/markdown 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/ */

    

comfyphp / markdown example snippets


$config = [
    "setBreaksEnabled" => true,
    "setMarkupEscaped" => true,
    "setUrlsLinked" => false,
    "setSafeMode" => true,
];

// This extension will modify the router and document of ComfyPHP
$router = new ComfyPHP\Markdown\Router();
$document = new ComfyPHP\Markdown\Document($config);

$core = new ComfyPHP\Core([
    "router" => $router,
    "document" => $document,
]);

$core->getRouter()->get("/md", "/markdown/index");

$core->fileBasedRouter();