cyber-duck / blade-extensions
Laravel package providing additional Blade extensions: foreach (with $loop data like twig), break, continue, set,array (multiline), etc
Requires
- php: >=5.5.9
- composer/semver: ~1.4
- illuminate/contracts: ~5.0|~6.0|~7.0|~8.0
- illuminate/filesystem: ~5.0|~6.0|~7.0|~8.0
- illuminate/support: ~5.0|~6.0|~7.0|~8.0
- illuminate/view: ~5.0|~6.0|~7.0|~8.0
Requires (Dev)
- cebe/markdown: ~1.1
- laradic/testing: ~1.0.3
- matthiasmullie/minify: ~1.3
- mockery/mockery: ~0.9|~1.0
- zaininnari/html-minifier: ~0.4
Suggests
- cebe/markdown: Enables the use of @markdown directives (~1.5)
- matthiasmullie/minify: Enables the use of @minify('css') or @minify('js') directive (~1.3)
- raveren/kint: Improved @dump output (1.0.*)
- zaininnari/html-minifier: Improves the @minify('html') directive
- 8.0.2
- 8.0.1
- 8.0.0
- dev-master / 7.4.x-dev
- 7.3.0
- 7.2.0
- 7.1.0
- 7.0.2
- 7.0.1
- 7.0.0
- 7.0.0-beta
- 6.2.5
- 6.2.4
- 6.2.3
- 6.2.2
- 6.2.1
- 6.2.0
- 6.1.0
- 6.0.6
- 6.0.5
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.0.0
- v4.1.x-dev
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- v3.0.x-dev
- 3.0.2
- 3.0.1
- 3.0.0
- v2.2.x-dev
- v1.2.x-dev
- 1.1.0
- dev-develop
- dev-test
- dev-feature/if-section
- dev-feature/travis-automerge
- dev-scrutinizer-patch-1
This package is auto-updated.
Last update: 2024-10-19 21:05:49 UTC
README
A Laravel package providing additional Blade functionality.
Tested on all Laravel 5.x & 6.x versions. Supports Laravel 7.x
The package follows the FIG standards PSR-1, PSR-2, and PSR-4 to ensure a high level of interoperability between shared PHP code.
Version 8.0
Features
- Compatible with all Laravel 5 & 6 versions
- 20+ Configurable, nameable, extendable, replaceable, testable directives.
- Compile Blade strings with variables
BladeExtensions::compileString($string, array $vars = [])
- Progamatically push content to a stack inside blade view(s)
BladeExtensions::pushToStack($stack, $views, $content)
- Even if you don't use any of the directives, Blade Extensions provides you with a great method to manage your directives.
Directives
All directives can be disabled, extended or replaced.
- @set / @unset Setting and unsetting of values
- @breakpoint / @dump Dump values to screen and set breakpoints in views
- @foreach / @break / @continue Loop data and extras (similair to twig
$loop
) - @embed Think of embed as combining the behaviour of include and extends. (similair to twig
embed
) - @minify / @endminify Minify inline code. Supports CSS, JS and HTML.
- @macro / @endmacro/ @macrodef Defining and running macros
- @markdown/ @endmarkdown
- @spaceless / @endspaceless
- and more...
Installation
1. Composer
"radic/blade-extensions": "~7.1"
2. Laravel
Radic\BladeExtensions\BladeExtensionsServiceProvider::class
3.Configuration
The first version of this package was created for Laravel 4.2. In the later releases Laravel introduced quite a few similar directives/functionality like the foreach loop variable, Components & Slots, etc. This package automaticly disables some directives depending on your Laravel version. The configuration file allows you to fully configure this behaviour. Make sure to check it out.
Copyright/License
Copyright 2015 Robin Radic - MIT Licensed