2017 © Pedro Peláez
 

library blade-set

A very simple blade extension which allows variables to be set.

image

alexdover/blade-set

A very simple blade extension which allows variables to be set.

  • Tuesday, October 3, 2017
  • by alexdover
  • Repository
  • 1 Watchers
  • 23 Stars
  • 52,164 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

Laravel 4 Blade @set operator

A very simple blade extension which allows variables to be set., (*1)

Current version is for Laravel 4.2., (*2)

If you wish to use with Laravel 4.1, please use v1.0.2, (*3)

Example

@set('my_variable', $existing_variable)

You can then use the variable $my_variable in the template., (*4)

You might choose to fetch a bunch of models from your template, for example, (*5)

@set('my_model_list', MyModel::where('something', '=', 1)->paginate(10))

Why?

Compare, (*6)

<?php $my_model_list = MyModel::where('something', '=', 1)->paginate(10); ?>

to, (*7)

@set('my_model_list', MyModel::where('something', '=', 1)->paginate(10))

I felt that the use of the @set was a more elegant solution in the context of blade templates., (*8)

Installation

Require this package in your composer.json and update composer. This will download the package., (*9)

"alexdover/blade-set": "1.*"

After updating composer, add the ServiceProvider to the providers array in app/config/app.php, (*10)

'Alexdover\BladeSet\BladeSetServiceProvider',

All done!, (*11)

Licence

You can use this package under the MIT license, (*12)

Feedback

If you have any questions, feature requests or constructive ctritcism then please get in touch., (*13)

Twitter - @alexdover, (*14)

The Versions

03/10 2017

dev-master

9999999-dev

A very simple blade extension which allows variables to be set.

  Sources   Download

MIT

The Requires

 

by Alex Dover

laravel blade

03/10 2017

v1.0.4

1.0.4.0

A very simple blade extension which allows variables to be set.

  Sources   Download

MIT

The Requires

 

by Alex Dover

laravel blade

19/07 2014

v1.0.3

1.0.3.0

A very simple blade extension which allows variables to be set.

  Sources   Download

MIT

The Requires

 

by Alex Dover

laravel blade

11/06 2014

v1.0.2

1.0.2.0

A very simple blade extension which allows variables to be set.

  Sources   Download

MIT

The Requires

 

by Alex Dover

laravel blade

09/06 2014

v1.0.1

1.0.1.0

A very simple blade extension which allows variables to be set.

  Sources   Download

MIT

The Requires

 

by Alex Dover

laravel blade

09/06 2014

v1.0

1.0.0.0

A very simple blade extension which allows variables to be set.

  Sources   Download

MIT

The Requires

 

by Alex Dover

laravel blade