Download the PHP package thejager/directives without Composer
On this page you can find all versions of the php package thejager/directives. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download thejager/directives
More information about thejager/directives
Files in thejager/directives
Download thejager/directives
More information about thejager/directives
Files in thejager/directives
Vendor thejager
Package directives
Short Description A simpler way to define partial-like custom Blade directives using Blade files.
License MIT
Package directives
Short Description A simpler way to define partial-like custom Blade directives using Blade files.
License MIT
Please rate this library. Is it a good library?
Informations about the package directives
Directives
this package allows you to easily add new directives from Blade files.
How to set it up.
- First thing you need to do is install the package. You can do this with composer by running 'composer require thejager/directives'.
- Next thing you need to do is add the service provider
TheJager\Directives\DirectivesServiceProvider
to your config/app.php. - Create the directory 'resources/views/directives'.
How to use it (example)
Let's create a @date()
directive. When using @date(Carbon\Carbon::now())
in a blade view, we want it to output the current date in dd-mm-yyyy format.
- First thing we do is create the blade file. Create a new Blade template 'date.blade.php' in the 'resources/views/directives/' folder containing
{{ $param->format('d-m-Y') }}
. Note that the parameter passed to the directive is stored in$param
. At this moment you can not pass multiple parameters, but you could pass an array of parameters if you want ;) - That's it. You can now use the
@date()
directive in your Blade files to which you can pass any Carbon instance.
Suggestions
Feel free to suggest changes, collaborate, suggest new features etc.
All versions of directives with dependencies
PHP Build Version
Package Version
Requires
illuminate/support Version
~5.2
The package thejager/directives contains the following files
Loading the files please wait ....