From a301b61093aca4f7de67a966b6ddfd8cf2296695 Mon Sep 17 00:00:00 2001 From: Xiphoseer Date: Fri, 7 Dec 2018 18:24:41 +0100 Subject: [PATCH] Use Blade::directive instead of Blade::extend (#237) * Add blade directives; Remove use of require_once * Update README for renamed lm_attrs * Use constants correctly * Update @lm_attrs syntax in examples * Add deprecation warning --- README.md | 6 +- src/Lavary/Menu/ServiceProvider.php | 60 ++++++++++++++++++- src/Lavary/Menu/blade/lm-attrs.php | 56 ----------------- .../views/bootstrap-navbar-items.blade.php | 6 +- 4 files changed, 64 insertions(+), 64 deletions(-) delete mode 100644 src/Lavary/Menu/blade/lm-attrs.php diff --git a/README.md b/README.md index 4415498..125a30b 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ __For Laravel 4.x, check [version 1.5.0](https://github.com/lavary/laravel-menu/ * [Advanced Usage](#advanced-usage) + [A Basic Example](#a-basic-example) + [Control Structure for Blade](#control-structure-for-blade) - - [@lm-attrs](#lm-attrs) + - [@lm_attrs](#lm_attrs) + [Attributes and Callback function of item](#attributes-and-callback-function-of-item) * [Configuration](#configuration) * [If You Need Help](#if-you-need-help) @@ -1472,7 +1472,7 @@ To put the rendered menu in your application template, you can simply include `c Laravel menu extends Blade to handle special layouts. -##### @lm-attrs +##### @lm_attrs You might encounter situations when some of your HTML properties are explicitly written inside your view instead of dynamically being defined when adding the item; However you will need to merge these static attributes with your Item's attributes. @@ -1501,7 +1501,7 @@ The view: ```php @foreach($items as $item) - hasChildren()) class="dropdown" @endif data-test="test" @lm-endattrs> +
  • hasChildren()) class="dropdown" @endif data-test="test" @lm_endattrs> {!! $item->title !!} @if($item->hasChildren()) @endif
  • @if($item->divider)