Skip to content

A minimalist ZF2 module for adding markdown support to Zend Framework 2 projects

Notifications You must be signed in to change notification settings

LitusProject/EdpMarkdown

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EdpMarkdown - ZF2 Markdown Module

Version 0.0.1 Created by Evan Coury

Introduction

This ZF2 module simply adds Markdown support to your project. It utilizes the PHP Markdown library written by Michel Fortin which is a PHP port of the original perl implementation by John Gruber.

Installation

To install EdpMarkdown, simply recursively clone this repository (git clone --recursive) into your ZF2 modules directory and enable it in your config/application.config.php file. That's it!

Usage

With this module installed, using Markdown in your view scripts is easy:

<?= $this->markdown('Hello, **this** is _Markdown_!'); ?>

NOTE: For security purposes, the output SHOULD be sanitized if the Markdown is from an untrusted source. (@padraic says so!) See the Markdown documentation on inline HTML to understand why this is necessary.

Configuration

By default, this module uses the "Markdown Extra" parser. If you'd like to switch it to just use the normal markdown parser, you can simply define the MARKDOWN_PARSER_CLASS, which PHP Markdown is configured to check for. An easy place to do this would be in a config file such as ./config/autoload/global.php.

<?php
define('MARKDOWN_PARSER_CLASS',  'Markdown_Parser');

About

A minimalist ZF2 module for adding markdown support to Zend Framework 2 projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%