Skip to content

Commit 44084f3

Browse files
committed
Update readme for 0.2.0 refactoring + misc. cleanup.
1 parent fa074ba commit 44084f3

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,32 @@ add_action('after_setup_theme', function (){
5151

5252
**Important** Since this package is introducing new Blade directives, you should clear your cached/compiled Blade files. Those files are located in `wp-content\uploads\cache`.
5353

54+
## Configuration Files
55+
Currently, you have to copy and paste the sample config files into your theme `config` directory. You can find them in the `vendor\webstractions\sage-xpress\config` directory.
56+
57+
The configuration files are a major component of SageXpress that drives the Providers (more below).
58+
59+
- `app.php` Registers theme environment, providers, composers, and aliases.
60+
- `blade-directives.php` For your custom Blade directives.
61+
- `comments.php` Comment form configuration. Other comments related tasks.
62+
- `menu.php` Register nav menus and configurations.
63+
- `sidebar.php` Register sidebars and configurations.
64+
5465
## Overview
5566
Outside of one line of code that you need to add to `setup.php` and the config files, there is nothing else you need to do. Config files are automatically registered with the Sage Container, no messing with `functions.php`.
5667

5768
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.
5869

59-
### Blade Directives
70+
## The SageXpress Provider
71+
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.
72+
73+
Providers are autoloaded via the `config\app.php` congifuration file during the SageXpress boot process. The providers are then bound to the Sage Container where you can use or reference them from your theme classes and controllers.
74+
75+
Providers handle WordPress-centric methods for registration, filters, etc. The `render()` method can be used for the creation of custom Blade directives.
76+
77+
### Blade Directives Provider
78+
Provides some handy Blade directives targetted mostly for WordPress use, but other helpful functionality as well.
79+
6080
There are a whole slew of directives, and requires its own [Blade Directives Documentation](https://github.com/webstractions/sage-xpress/tree/master/docs/blade.md).
6181

6282
One example, the `@loop` directive does a nice job of cleaning up your templates.

0 commit comments

Comments
 (0)