Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 15, 2019

Conversation

jasonmccreary
Copy link
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
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
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