2017 © Pedro Peláez
 

library slim-markdown-view

Render PHP view scripts into a PSR-7 Response object.

image

davidepastore/slim-markdown-view

Render PHP view scripts into a PSR-7 Response object.

  • Sunday, November 20, 2016
  • by DavidePastore
  • Repository
  • 1 Watchers
  • 5 Stars
  • 126 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 15 % Grown

The README.md

Slim Markdown Renderer

Latest version ![Build Status][ico-travis] Coverage Status ![Quality Score][ico-code-quality] Total Downloads PSR2 Conformance, (*1)

A renderer for rendering Markdown into a PSR-7 Response object. It works well with Slim Framework 3., (*2)

Installation

Install with Composer:, (*3)

composer require davidepastore/slim-markdown-view

Usage With Slim 3

use \DavidePastore\Slim\Views\MarkdownRenderer;

include "vendor/autoload.php";

$app = new Slim\App();
$container = $app->getContainer();
$container['renderer'] = new MarkdownRenderer("./templates");

$app->get('/hello/', function ($request, $response) {
    return $this->renderer->render($response, "/hello.md");
});

$app->run();

Usage with any PSR-7 Project

//Construct the View
$markdownView = new MarkdownRenderer("./path/to/templates");

//Render a file
$response = $markdownView->render(new Response(), "/path/to/template.md");

Custom Parsedown instance

//Construct the View
$parsedown = Parsedown::instance()->setUrlsLinked(false);
$markdownView = new MarkdownRenderer("./path/to/templates", $parsedown);

//Render a file
$response = $markdownView->render(new Response(), "/path/to/template.md");

Exceptions

\RuntimeException - if template does not exist, (*4)

Testing

bash $ phpunit, (*5)

Contributing

Please see CONTRIBUTING for details., (*6)

Credits

The Versions

20/11 2016

dev-master

9999999-dev

Render PHP view scripts into a PSR-7 Response object.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Davide Pastore

framework template markdown renderer slim view md

12/08 2016

v0.1.1

0.1.1.0

Render PHP view scripts into a PSR-7 Response object.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Davide Pastore

framework template markdown renderer slim view md

06/03 2016

v0.1.0

0.1.0.0

Render PHP view scripts into a PSR-7 Response object.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Davide Pastore

framework template markdown renderer slim view md