@@ -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
168168Want 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
179179abstract class FromFile implements RenderableScript
0 commit comments