PHP code example of bluebaytravel / phrontmatter

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

    

bluebaytravel / phrontmatter example snippets


// Parse a document.
Phrontmatter::parse("---\nfoo: bar---\nThis is actual content!")->foo;

// Dependency injection example.
$phrontmatter->parse("---\nfoo: bar---\nThis is actual content!")->getContent();

// Parse a document with JSON meta data.
$phrontmatter->parse("---\n{\"foo\":\"bar\"}\n---\nThis is a document with JSON!", Phrontmatter::JSON)->getData();

BlueBayTravel\Phrontmatter\PhrontmatterServiceProvider::class

'Phrontmatter' => BlueBayTravel\Phrontmatter\Facades\Phrontmatter::class