From 763b8c7fde749eb8342e0f2f07dd0d8fe936dcfb Mon Sep 17 00:00:00 2001 From: Andreas Ek Date: Fri, 15 Jan 2016 11:20:46 +0100 Subject: [PATCH] readme update --- readme.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 573ffca..cadcce5 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,9 @@ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://packagist.org/packages/ekandreas/bladerunner) [![Build Status](https://travis-ci.org/ekandreas/bladerunner.svg?branch=master)](https://travis-ci.org/ekandreas/bladerunner) +[![StyleCI](https://styleci.io/repos/48002506/shield)](https://styleci.io/repos/48002506) +[![Twitter Follow](https://img.shields.io/twitter/follow/shields_io.svg?style=social)](https://twitter.com/intent/user?screen_name=aekabse) + WordPress plugin for Laravel Blade templating. @@ -13,7 +16,7 @@ composer require ekandreas/bladerunner:* Activate the plugin inside WordPress and templates with *.blade.php are inspected and active. Your theme still needs an index.php due to WordPress basic functionality. When removed the theme is known as broken. -If you don't use a composer based WordPress development environment you can download the latest distributed plugin at [Bladerunner site](http://bladerunner.aekab.se) and install it the common way with zip upload to WordPress via wp-admin. +If you don't use a composer based WordPress development environment you can download the latest distributed plugin at [Bladerunner site http://bladerunner.aekab.se](http://bladerunner.aekab.se) and install it the common way with zip upload to WordPress via wp-admin. ## Hello World 1. Install the library with composer @@ -38,12 +41,25 @@ https://laravel.com/docs/5.2/blade * Your views must be placed within your theme folder. * Your templates must have .blade.php extension. +## Pass data to template +A simple way to pass data to a view before it's loaded. + +Run the below code (and change variableName and $value) before the template_include filter (or in the template_include filter with higher priority than 999) to pass data to the soon to be loaded view. +``` +\Bladerunner\Template::$data['variableName'] = $value; +``` + +Inside your view file you will be able to access the passed data like so: +``` +{{ $variableName }} +``` + ## Links +* [Bladerunner site with documentation and distro](http://bladerunner.aekab.se) * [Docs Laravel Blade v5.2](https://laravel.com/docs/5.2/blade) * [Packagist](https://packagist.org/packages/ekandreas/bladerunner) * [Code repo at Github](https://github.com/ekandreas/bladerunner) * [Support / Issues](https://github.com/ekandreas/bladerunner/issues) -* [Get a WordPress zip distro](http://bladerunner.aekab.se) ## Tests