2017 © Pedro Peláez
 

library view

Set of tools for enhancing Laravel blade view management

image

white-frame/view

Set of tools for enhancing Laravel blade view management

  • Tuesday, May 17, 2016
  • by ifnot
  • Repository
  • 1 Watchers
  • 6 Stars
  • 338 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

View

Set of tools for enhancing Laravel blade view management., (*1)

Install with composer :, (*2)

composer require white-frame/view:0.*

Register the service provider :, (*3)

WhiteFrame\View\ViewServiceProvider::class

Nesting views into another views (hooking blade view sections)

The facade WhiteFrame\View allows you to nest blade view into another blade views. It can be usefull if you have a modular application witch need to dynamically add content into sections etc ..., (*4)

Simple example :

Here is your general layout.blade.php, with a sidebar-menu section. This section has two default links and need to be filled with other new menu links from dynamic modules :, (*5)

<!DOCTYPE html>
[ ... ]
<body>
<section class="sidebar">
    <ul class="sidebar-menu">
        @section("sidebar-menu")
          <li><a href="{{ url('layout_page_1') }}">Layout page 1<</a></li>
          <li><a href="{{ url('layout_page_2') }}">Layout page 2</a></li>
        @show
    </ul>
</section>
[...]
</body>
</html>

In a specific module, create a partial view to be included, for example my_module::layout.menu :, (*6)

@section("sidebar-menu")
    @parent

    <li><a href="{{ url('my_module/my_page') }}">My module page</a></li>
@stop
````

And then nest this partial view into the layout section using `WhiteFrame\View` into the service provider of your module :

```php
public function boot()
{
  \WhiteFrame\View::nest('layout', 'my_module::layout.menu');
  /*
   * You can use 3 params : nest view (host), nested view (child), array containing datas for nested view (optionnal)
   */
}

The Versions

17/05 2016

5.1.x-dev

5.1.9999999.9999999-dev

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre

15/04 2016

5.1.0.1

5.1.0.1

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre

18/02 2016

5.1.0.0

5.1.0.0

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre

19/01 2016

5.2.x-dev

5.2.9999999.9999999-dev

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre

19/01 2016

5.2.0.0

5.2.0.0

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre

20/11 2015

0.03

0.03.0.0

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre

19/11 2015

0.02

0.02.0.0

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre

19/11 2015

v0.01

0.01.0.0

Set of tools for enhancing Laravel blade view management

  Sources   Download

WTFPL

The Requires

 

by Anael Favre