PHP code example of mattmezza / blog-manager

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

    

mattmezza / blog-manager example snippets




$config = array(
  "posts" => array(
    "dir" => __DIR__ . "/posts",
    "perpage" => 5
  ),
  "pages" => array(
    "dir" => __DIR__ . "/pages/"
  ),
  "url" => "http://localhost:8000"
);

$bm = new Blog\Manager($config);
$page = $bm->get_page("test");

// echo $page->title;
echo $page->body;
// echo $page->metas->wooow;