PHP code example of ronanguilloux / silexmarkdownserviceprovider

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

    

ronanguilloux / silexmarkdownserviceprovider example snippets

 php


# app.php

use Rg\Silex\Provider\Markdown\MarkdownServiceProvider;

$app->register(new MarkdownServiceProvider(), array(
    'md.path' => __DIR__ .'/relative-path-to-markdown-files-directory')
);

// Retrieve .md file content
$markdown = $app['md.finder']->getContent('path-to-mardown-file');

// Parse it into html
$html = $app['md.parser']->transform($markdown);