vkbansal/frontmatter

This package is abandoned and no longer maintained. The author suggests using the webuni/front-matter package instead.

Frontmatter allows page-specific variables to be included at the top of a template using the YAML,JSON or INI format.

v1.3.2 2015-07-12 15:33 UTC

README

use https://github.com/webuni/front-matter instead

Latest Stable Version Build Status Scrutinizer Code Quality Code Coverage Code Climate License Dependency Status

SensioLabsInsight #FrontMatter Frontmatter allows page-specific variables to be included at the top of a template using the YAML or JSON format.

##Requirements

  • PHP >= 5.4

##Installation Create or update your composer.json and run composer update

$ composer require vkbansal/frontmatter

##Supported Formats

  • YAML
  • JSON
  • INI

Quick usage

<?php

require '../vendor/autoload.php';

use VKBansal\FrontMatter\Parser;
use VKBansal\FrontMatter\Document;

//Parse a document
$doc = Parser::parse(<<<EOF
---
layout: custom
my_list:
    - one
    - two
    - three
---
Main Title
-----
### Subtitle

Lorem ipsum......
EOF
);

var_dump($doc->getConfig()); // ['layout' => 'custom', 'my_list' => ['one', 'two',  'three']]
var_dump($doc->getContent());
/*
Main Title
-----
### Subtitle

Lorem ipsum.....
*/

For more detailed usage see website

##License MIT

##Changelog Changelog