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

Projects
None yet
3 participants
@jasonmccreary
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

jasonmccreary commented Mar 14, 2019

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

@browner12

This comment has been minimized.

Copy link
Contributor

browner12 commented Mar 14, 2019

it says you need a space after your !

@jasonmccreary jasonmccreary force-pushed the jasonmccreary:even-odd-loop-variables branch from dd0485c to c443c83 Mar 14, 2019

@taylorotwell taylorotwell merged commit 94cc6a4 into laravel:5.8 Mar 15, 2019

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jasonmccreary jasonmccreary deleted the jasonmccreary:even-odd-loop-variables branch Mar 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.