You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-1Lines changed: 21 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,12 +51,32 @@ add_action('after_setup_theme', function (){
51
51
52
52
**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`.
53
53
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
+
54
65
## Overview
55
66
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`.
56
67
57
68
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.
58
69
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
+
60
80
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).
61
81
62
82
One example, the `@loop` directive does a nice job of cleaning up your templates.
0 commit comments