Download the PHP package awkwardideas/switchblade without Composer
On this page you can find all versions of the php package awkwardideas/switchblade. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download awkwardideas/switchblade
More information about awkwardideas/switchblade
Files in awkwardideas/switchblade
Download awkwardideas/switchblade
More information about awkwardideas/switchblade
Files in awkwardideas/switchblade
Vendor awkwardideas
Package switchblade
Short Description Extended blade directives for laravel
License MIT
Package switchblade
Short Description Extended blade directives for laravel
License MIT
Please rate this library. Is it a good library?
Informations about the package switchblade
SwitchBlade: Custom Directives for the Laravel Blade templating engine
Install Via Composer
Add to config/app.php
Under Package Service Providers Add
Available Directives
Switch via Blade
A php switch statement implemented via blade.
The switch statement is similar to a series of IF statements on the same expression. In many occasions, you may want to compare the same variable (or expression) with many different values, and execute a different piece of code depending on which value it equals to. This is exactly what the switch statement is for.
-
- This is the blade call to start the switch. It requires the expression and the first case statement. Optionally you can add as many case statements as you would like, which would all execute the code between the start of the switch and the first call.
-
- Add this to end the case statement. Only one is needed to stop all prior cases.
-
- Add this to start a case statement. Optionally you can add as many case statements as you would like, which would all execute the code between the and next call.
-
- Add this near the bottom of the switch to handle any variants of the expression which may not have been captured by a case statement. No end case is necessary since it will end with
-
- Add this to end your switch statement
Variable Modification
Set, increment or decrement variables without having to go in and out of php.
Variable Output
-
- Echos the value safe for use in html attributes like id
-
- Echos the index of the exploded result of the string, split by the delimiter
-
- Echos the string result of the array joined by the delimiter
Debug Tools
-
- Does a dump and die on the variable
-
- Does a dump of the variable
-
- Echos the environment variable
Other helpful directives
-
- Adds a php continue; tag to skip the rest of the current loop iteration
-
- Adds a php break; tag which ends the execution of a for, foreach, do-while or switch structure
If empty
-
- If count of variable == 0
-
- Ends if empty statement
If null
-
- If variable is null
-
- Ends if null statement
Not Null
-
- If variable is not null
-
- Ends not null statement
Optional Yield
-
- Outputs the content wrapped only if the referenced section has value
-
- Ends optional output statement
File exists
-
- Tests file path, continuing only if file exists
-
- Ends file exists condition
Has Count
-
- Obtains the count of the variable, continuing if it is greater than 0
-
- Ends has count condition
Lang Modification
-
- Modified to pass through to choice of 1, allowing plurals to be put in without having to have all singular usages changed to choice.
Bag
-
- Appends a variable to a bag, or echos the bag as a list
Init Script
-
- Adds the script name to a bag if a parameter is passed. If no parameter is passed, the contents of the bag are dumped into a javascript window property.
All versions of switchblade with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6.4
The package awkwardideas/switchblade contains the following files
Loading the files please wait ....