PHP code example of smith981 / knp-markdown-bundle

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

    

smith981 / knp-markdown-bundle example snippets


$bundles = array(
    // ...
    new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
);

// Use the service
$html = $this->container->get('markdown.parser')->transformMarkdown($text);

// Use the helper with default parser
echo $view['markdown']->transform($text);

// Use the helper and a select specific parser
echo $view['markdown']->transform($text, $parserName);