Skip to content

[5.8] Adds even and odd flags to the Loop variable#27883

Merged
taylorotwell merged 1 commit intolaravel:5.8from
jasonmccreary:even-odd-loop-variables
Mar 15, 2019
Merged

[5.8] Adds even and odd flags to the Loop variable#27883
taylorotwell merged 1 commit intolaravel:5.8from
jasonmccreary:even-odd-loop-variables

Conversation

@jasonmccreary
Copy link
Copy Markdown
Contributor

@jasonmccreary jasonmccreary commented Mar 14, 2019

The Loop Variable is an exceptionally helpful and underutilized feature within Blade. This adds a few convenience properties of even and odd.

Having these explicit variables is beneficial when designing repeated UI elements (e.g. zebra stripes), and prevents using otherwise dense syntax (e.g. $loop->iteration % 2) providing that smooth artisan flow Laravel is known for.

If merged, will open a PR to update the Docs as well.

@GrahamCampbell GrahamCampbell changed the title Adds even and odd flags to the Loop variable [5.8] Adds even and odd flags to the Loop variable Mar 14, 2019
@jasonmccreary
Copy link
Copy Markdown
Contributor Author

Glad to fix the formatting issue, but I can't tell what's wrong. 😅 Normally there is a hint in their details…

@browner12
Copy link
Copy Markdown
Contributor

it says you need a space after your !

@jasonmccreary jasonmccreary force-pushed the even-odd-loop-variables branch from dd0485c to c443c83 Compare March 14, 2019 19:40
@taylorotwell taylorotwell merged commit 94cc6a4 into laravel:5.8 Mar 15, 2019
@jasonmccreary jasonmccreary deleted the even-odd-loop-variables branch March 18, 2019 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants