PHP code example of maglnet / magl-markdown

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

    

maglnet / magl-markdown example snippets


array(
	'modules' => array(
		'Application',
		'MaglMarkdown',
	),
);

$this->markdown('Yes, **this** is *Markdown*!');

/* @var $markdownService MaglMarkdown\Service\Markdown */
$markdownService = $serviceManager->get('MaglMarkdown\MarkdownService');
$html = $markdownService->render('Yes, **this** is *Markdown*!');

/* @var $markdownAdapter MaglMarkdown\Adapter\MarkdownAdapterInterface */
$markdownAdapter = $serviceManager->get('MaglMarkdown\MarkdownAdapter');
$html = $markdownAdapter->transformText('Yes, **this** is *Markdown*!');

array(
	'aliases' => array(
		'MaglMarkdown\MarkdownAdapter' => 'Your\Own\MarkdownAdapter', //needs to implement MaglMarkdown\Adapter\MarkdownAdapterInterface
	),
)
bash
$ php composer.phar update