Skip to content

Commit

Permalink
Updated Doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanta94 committed Nov 11, 2024
1 parent 5db1b1c commit 9001c0c
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,25 @@ add_action( 'plugins_loaded', function() {
Now you can specify "group paths" in your application. This enables you to load assets which are stored in locations outside of your path set through `Config::set_path( PATH_TO_YOUR_PROJECT_ROOT );`

```php
Config::add_group_path( 'group-path-slug', GROUP_PATH_ROOT, 'group/path/relevant/path' );
Config::add_group_path( 'group-path-slug', GROUP_PATH_ROOT, 'group/path/relevant/path', true );
```

**Note**: Specifying the 4th parameter of add_group_path method as true, means that all the assets that belong to the specified `group-path-slug` will have their paths prefixed with `css` or `js`.

For example:

```php
Config::add_group_path( 'group-path-slug', GROUP_PATH_ROOT, 'group/path/relevant/path', true );

Asset::add( 'another-style', 'css/another.css' )
->add_to_group_path( 'group-path-slug' );

// This asset's would be found in GROUP_PATH_ROOT . 'group/path/relevant/path' . '/css/css/another.css'
```

If you don't want the above to happen you would either specify false or leave the 4th parameter to its default state. Then the asset of the above example would be found in:
`GROUP_PATH_ROOT . 'group/path/relevant/path' . '/css/another.css'`

## Register and enqueue assets

There are a lot of options that are available for handling assets
Expand Down

0 comments on commit 9001c0c

Please sign in to comment.