Skip to content

Commit 0634b97

Browse files
committed
Update readme file.
1 parent a1a9a7b commit 0634b97

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
44
[![Build Status](https://travis-ci.org/webstractions/sage-xpress.svg?branch=master)](https://travis-ci.org/webstractions/sage-xpress)
55

6-
A collection of extensions for your Roots\Sage 9.x beta themes.
6+
A collection of extensions, providers, and Blade revisions for your Roots\Sage 9.x beta themes.
77

88
- **Blade Directives:** @directives for loop, query, sidebar, FontAwesome, and more.
99
- **Menu Provider:** Register nav menu and markup via configuration file.
1010
- **Sidebar Provider:** Register sidebar and widget markup via configuration file.
1111
- **Comment Form Provider:** Register comment form markup via configuration file.
1212
- **Schema Provider** Quickly add schema.org markup via @schema directive.
13+
- **Facade/Alias Support** Provide a "static" interface to classes that are bound to the Sage container.
14+
- **Blade Fixes** Fixes Blade `@inject` directive and 5.5's `Blade::if()` method.
1315

1416
## Requirements
1517
This package is specifically built for `Roots\Sage 9.0.0-beta.4` and above. It goes without saying that your development server needs to have `Php 7.0` or greater as well.
@@ -67,6 +69,25 @@ Outside of one line of code that you need to add to `setup.php` and the config f
6769

6870
Additionally, your `setup.php` file should actually be leaner. No need for `widgets_init`, `register_nav_menus`, and funky `wp_nav_menu` callouts in your controllers or blade files. The providers automatically do the registration for you based on your configurations and there are Blade Directives to spew them out.
6971

72+
## Facades and Aliases
73+
You can now register `aliases` via the `config\app.php` configuration file. Currently, there are standard Laravel Facades for Blade, Config, Event, File, and View. Facades for SageXpress providers are in a state of flux and currently supports Comments, Menu, and Sidebar.
74+
75+
With Facades, you can reference bound providers with unruly instantiation and method calls like the following.
76+
77+
Instead of
78+
```php
79+
sage('blade')->compiler()->directive('name', function ($expression) {
80+
// Handle the directive.
81+
});
82+
```
83+
You can:
84+
```php
85+
Blade::directive('name', function ($expression) {
86+
// Handle the directive.
87+
});
88+
```
89+
Facades have some advantages. Rather than list the pros and cons of Facades, and how they work, please reference the [Laravel Facade Documentation](https://laravel.com/docs/5.4/facades).
90+
7091
## The SageXpress Provider
7192
SageXpress providers are similar to Laravel Service Providers, but they contain additional methods for `config()` and `render()`. You can think of them as configurable components that can be rendered in a Blade view.
7293

0 commit comments

Comments
 (0)