2017 © Pedro Peláez
 

library yaml-front-matter

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

image

modularr/yaml-front-matter

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  • Thursday, April 5, 2018
  • by Blaxus
  • Repository
  • 4 Watchers
  • 30 Stars
  • 390 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 11 Versions
  • 1 % Grown

The README.md

YAML Front Matter

Latest Version Software License Build Status Total Downloads, (*1)

An easy to use class for handling YAML frontmatter in PHP., (*2)

What does this class do?

This class is a PHP implementation of Jekyll Front Matter., (*3)

Any file that contains a YAML front matter block will be processed as a special file. The front matter must be the first thing in the file and must take the form of valid YAML set between triple-dashed lines. Here is a basic example:, (*4)

---
layout: post
title: Blogging Like a Hacker
---

Between these triple-dashed lines, you can set variables using YAML. You can access them via the fetch function. Conversion to Markdown is optional., (*5)

How to use

$page = new \Modularr\YAMLFrontmatter\FrontMatter('content/example.md');

echo '

'.$page->fetch('title').'

'.$page->fetch('content'); foreach($page->fetch('list') as $key => $value) { echo '<li>'.$key.' => '.$value.'</li>'; } $array = $page->fetch('list'); echo $array['foo'];
---
foo: bar
title: Test
info: you can have as many custom fields as you like
date: 2005-09-16 17:20:42+00:00
layout: post
comments: true
slug: testing
list: { foo: bar, bar: baz }
list2:
- foo
- bar
list3:
    foo: bar
    bar: baz
---
<h1>Text Here</h1>
<p>content</p>

Installation

Install in via Composer:, (*6)

composer require modularr/yaml-front-matter

If you are using the package in a VanillaJS project make sure you have:, (*7)

require_once 'vendor/autoload.php';

The Versions

05/04 2018

dev-master

9999999-dev

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

MIT proprietary

The Requires

 

The Development Requires

parser php metadata parsing frontmatter

05/04 2018

1.0.0

1.0.0.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser php metadata parsing frontmatter

17/05 2017

1.3.2

1.3.2.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser php metadata parsing frontmatter

14/05 2017

1.3.1

1.3.1.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser php metadata parsing frontmatter

10/05 2017

1.3.0

1.3.0.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

MIT

The Requires

 

The Development Requires

parser php metadata parsing frontmatter

23/02 2016

1.2.3

1.2.3.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

proprietary

The Development Requires

parser php metadata parsing frontmatter

07/02 2016

1.2.2

1.2.2.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

proprietary

The Development Requires

parser php metadata parsing frontmatter

14/09 2015

1.2.1

1.2.1.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

Unlicense

The Development Requires

parser php metadata parsing frontmatter

08/05 2015

1.2.0

1.2.0.0

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

Unlicense

The Development Requires

parser php metadata parsing frontmatter

08/03 2015

1.1.0

1.1.0.0 http://modularr.com

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

Unlicense

parser php metadata parsing frontmatter

12/04 2013

0.1.0

0.1.0.0 http://modularr.com

YAML-FrontMatter is a simple to use PHP only FrontMatter type parser Library.

  Sources   Download

Unlicense

parser php metadata parsing frontmatter