2017 © Pedro Peláez
 

library blade-alternator

image

kindari/blade-alternator

  • Monday, June 27, 2016
  • by kindari
  • Repository
  • 1 Watchers
  • 5 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Blade Alternator

Blade Alternator is a small extension to blade that adds the common operation of changing values throughout a loop. Now thats a horrible description, so heres an example:, (*1)

@foreach($users as $user)
    <tr class="@alternate('odd', 'even')">...</tr>
@endforeach

Which would result in alternating rows of a table, with the class switching between odd and even every time. This works with any number of arguments, for example, you might see a image gallery with three columns., (*2)

@foreach($images as $image)
    <img src="{{ $img->url }}" class="@alternate('left', 'mid', 'right')" />
@endforeach

Installation

Add kindari/blade-alternator to composer.json., (*3)

"kindari/blade-alternator": "1.0.*"

Run composer update to pull down the latest version of Blade Alternator. Now open up app/config/app.php and add the service provider to your providers array, after the ViewServiceProvider., (*4)

'providers' => array(
    ...
        'Illuminate\View\ViewServiceProvider',
        'Kindari\BladeAlternator\BladeAlternatorServiceProvider',
    ...
)

The Versions

27/06 2016

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Avatar kindari

05/09 2013

1.0.2

1.0.2.0

  Sources   Download

The Requires

 

by William Cahill-Manley

04/09 2013

1.0.1

1.0.1.0

  Sources   Download

The Requires

 

by William Cahill-Manley

04/09 2013

1.0.0

1.0.0.0

  Sources   Download

The Requires

 

by William Cahill-Manley