Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apollopy/blade-xforeach
A simple blade extension for foreach (supports laravel 4.2+).
https://github.com/apollopy/blade-xforeach
Last synced: about 1 month ago
JSON representation
A simple blade extension for foreach (supports laravel 4.2+).
- Host: GitHub
- URL: https://github.com/apollopy/blade-xforeach
- Owner: apollopy
- Created: 2015-04-22T10:54:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-26T08:44:33.000Z (over 9 years ago)
- Last Synced: 2024-10-15T14:11:27.063Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BladeXForeach
A simple blade extension for foreach (supports laravel 4.2+).
## Installation
Requirements
```JSON
"php": ">=5.4.0",
"illuminate/support": "4.2.*"
```Composer
```JSON
"repositories": [
{
"type": "git",
"url": "https://github.com/apollopy/blade-xforeach.git"
}
],
"require": {
"apollopy/blade-xforeach": "v1.3"
}
```Add the service provider in app/config/app.php:
```php
'ApolloPY\BladeXForeach\ServiceProvider'
```## Example
```php
@foreach ($arr as $key => $val)
@if ( @isforeachfirst($val) )
first
@endifkey = {{ $key }}
val = {{ $val }}{{ @foreachindex($val) }}
{{ @foreachiteration($val) }}@if ( @isforeachlast($val) )
end
@endif
@continue
@break
@endforeach
```