From 1ccf1ea3b4e6aecee99c6ff15cb6acbbb34f5c92 Mon Sep 17 00:00:00 2001 From: Daison Carino Date: Wed, 23 Mar 2016 02:31:57 +0000 Subject: [PATCH 1/4] Update regarding the directive --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9b2c30..343712a 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,16 @@ $blade = new Blade('views', 'cache'); echo $blade->make('homepage', ['name' => 'John Doe']); ``` -The Blade instances passes all methods to the internal view factory. So methods such as `exists`, `file`, `share`, `composer` and `creator` are available as well. Check out the [original documentation](http://laravel.com/docs/5.1/views) for more information. +Now you can easily create a directive by calling the ``compiler()`` function + +```php +$blade->compiler()->directive('datetime', function ($expression) { + return "format('F d, Y g:i a'); ?>"; +}); + +{{-- In your Blade Template --}} + +@datetime($dateObj) +``` + +The Blade instances passes all methods to the internal view factory. So methods such as `exists`, `file`, `share`, `composer` and `creator` are available as well. Check out the [original documentation](http://laravel.com/docs/5.2/views) for more information. From d364bad1bd92d78cfee021076b8a2d720c4def85 Mon Sep 17 00:00:00 2001 From: Daison Carino Date: Wed, 23 Mar 2016 02:34:07 +0000 Subject: [PATCH 2/4] Add integrations from other repositories --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 343712a..042cdeb 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,8 @@ $blade->compiler()->directive('datetime', function ($expression) { ``` The Blade instances passes all methods to the internal view factory. So methods such as `exists`, `file`, `share`, `composer` and `creator` are available as well. Check out the [original documentation](http://laravel.com/docs/5.2/views) for more information. + +Integrations +----- + +- [Phalcon Slayer Framework](https://github.com/phalconslayer/slayer) From 747886c57bcf1e2a73b3752a20d1edbacb9df8f1 Mon Sep 17 00:00:00 2001 From: Daison Carino Date: Wed, 23 Mar 2016 02:37:55 +0000 Subject: [PATCH 3/4] Add some context about the integrated framework --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 042cdeb..fab94df 100644 --- a/README.md +++ b/README.md @@ -48,4 +48,4 @@ The Blade instances passes all methods to the internal view factory. So methods Integrations ----- -- [Phalcon Slayer Framework](https://github.com/phalconslayer/slayer) +- [Phalcon Slayer Framework](https://github.com/phalconslayer/slayer) comes out of the box with Blade. From f66df5e64d7bf6af0037c256fa313b3cd0b61018 Mon Sep 17 00:00:00 2001 From: Daison Carino Date: Wed, 23 Mar 2016 03:44:00 +0000 Subject: [PATCH 4/4] Enhance the Blade class to apply some sort of PSR cs --- src/Blade.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Blade.php b/src/Blade.php index 1b88328..46ff51b 100644 --- a/src/Blade.php +++ b/src/Blade.php @@ -1,4 +1,5 @@ -