Skip to content

Commit 18fd0fe

Browse files
committed
chore: README updated
1 parent 5442d29 commit 18fd0fe

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Allows ✨:
66
- passing variables from PHP to JavaScript,
77
- process / modify the script in a dedicated PHP class.
88

9-
Extra - build in **ready-to-use** scripts:
9+
Additionally - has build in **ready-to-use** scripts:
1010
- theme switching script (two states - light/dark)
1111
- _more coming later_
1212

@@ -39,7 +39,7 @@ class AppServiceProvider extends ServiceProvider
3939
}
4040
```
4141

42-
Use the Blade directive in your template to inline the scripts:
42+
Use the custom Blade directive in your template to inline the scripts:
4343

4444
```blade
4545
<html>
@@ -167,13 +167,13 @@ Now hit the `d` key to toggle between light and dark themes, and your choice wil
167167

168168
Want to do more advanced processing of your JavaScript code before inlining it?
169169

170-
Create a PHP class that implements one of the following interfaces:
171-
- `RenderableScript` - for scripts without placeholders
172-
- `ScriptWithPlaceholders` - for scripts with placeholders to be replaced with variables
170+
Create a PHP class:
171+
- that implements the `RenderableScript` interface - using it you can fetch / prepare / create JS code in any way you want;
172+
- and use it with `BladeInlineScripts::take(...)` method.
173173

174-
And use them with `BladeInlineScripts::take(...)` method.
174+
Use interface `ScriptWithPlaceholders` for scripts with placeholders to be replaced with variables.
175175

176-
This package provides base abstract implementations (in the context of getting JS code from files) for each of the interfaces:
176+
Want to load JS code from a file? Extend the abstract class `FromFile` or `FromFileWithPlaceholders`.
177177

178178
```php
179179
abstract class FromFile implements RenderableScript

0 commit comments

Comments
 (0)