Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matks/markdownblogbundle
Markdown files based Bundle to integrate a simple blog in your Symfony application
https://github.com/matks/markdownblogbundle
bundle php symfony
Last synced: 17 days ago
JSON representation
Markdown files based Bundle to integrate a simple blog in your Symfony application
- Host: GitHub
- URL: https://github.com/matks/markdownblogbundle
- Owner: matks
- License: mit
- Created: 2016-05-01T17:24:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-22T14:07:26.000Z (almost 7 years ago)
- Last Synced: 2024-10-15T16:08:30.063Z (about 1 month ago)
- Topics: bundle, php, symfony
- Language: PHP
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
MarkdownBlogBundle
==================[![Latest Stable Version](https://poser.pugx.org/matks/markdown-blog-bundle/v/stable.svg)](https://packagist.org/packages/matks/markdown-blog-bundle)
[![Build Status](https://travis-ci.org/matks/MarkdownBlogBundle.svg?branch=master)](https://travis-ci.org/matks/MarkdownBlogBundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/matks/MarkdownBlogBundle/?branch=master)
[![License](https://poser.pugx.org/matks/markdown-blog-bundle/license.svg)](https://packagist.org/packages/matks/markdown-blog-bundle)Markdown files based Bundle to integrate a simple blog in your Symfony application
## Installation
Require the bundle
```bash
$ composer require matks/markdown-blog-bundle
```Enable the bundle in your Symfony application
```php
get('markdown_blog.library');/** @var Post[] $allPosts */
$allPosts = $library->getAllPosts();/** @var boolean $isPostRegistered */
$isPostRegistered = $library->isPostRegistered();/** @var Post $post */
$post = $library->getPostByName();/** @var Post[] $posts */
$posts = $library->getPostsByName();/** @var Post[] $posts */
$posts = $library->getPostsByDate();/** @var Post[] $posts */
$posts = $library->getPostsByCategory();/** @var Post[] $posts */
$posts = $library->getPostsByTag();```
You can now display your blog using any template you want. Example:
```php
getLibrary();
$allPosts = $library->getAllPosts();return $this->render(
'default/index.html.twig',
['posts' => $allPosts]
);
}/**
* @return Library
*/
private function getLibrary()
{
return $this->get('markdown_blog.library');
}
}
```You can have a look at the [markdown-blog-bundle-example](https://github.com/matks/markdown-blog-bundle-example).
It displays a blog using bootstrap templates.## Tests
### Stand alone context
In a bundle isolation context, just install the dev dependencies with composer
```bash
$ composer install
```Run the unit tests suite with atoum binary
```bash
$ vendor/bin/atoum -bf vendor/autoload.php -d Tests/Unit/
```Run functional tests with behat binary using the Symfony2 fixture application
```bash
$ vendor/bin/behat -c behat.ci.yml
```