ekandreas / bladerunner

WordPress plugin for Laravel Blade templating DEPRECATED
http://bladerunner.elseif.se
12 stars 1 forks source link

Added a way to pass data to a view #16

Closed Svanmark closed 8 years ago

Svanmark commented 8 years ago

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 }}
codecov-io commented 8 years ago

Current coverage is 0.00%

Merging #16 into master will not affect coverage as of 689f5fa

@@            master   #16   diff @@
====================================
  Files            4     4       
  Stmts          188   188       
  Branches         0     0       
  Methods         28    28       
====================================
  Hit              0     0       
  Partial          0     0       
  Missed         188   188       

Review entire Coverage Diff as of 689f5fa

Powered by Codecov. Updated on successful CI builds.

ekandreas commented 8 years ago

Thank you!