Appearance
AssetRegistry
php
final class Zairakai\LaravelBladeComponents\AssetRegistryRemembers which scripts and styles the rendered components need, so that a page only loads those.
A component asks for what it needs while it renders (script('dismiss')); zk-scripts and zk-styles, put after the content in the layout, print what was asked for.
Source: src/AssetRegistry.php
Constants
| Name | Value | Description |
|---|---|---|
SCRIPTS | ['dismiss', 'copy', 'modal', 'carousel', 'countdown', 'share', 'theme', 'consent'] | |
STYLES | ['carousel', 'code-group'] |
Methods
script()
php
public function script(string ...$names): voidscripts()
php
public function scripts(array $also = []): stringThe code of the scripts that were asked for, plus the given ones ("all" for every one of them).
style()
php
public function style(string ...$names): voidstyles()
php
public function styles(array $also = []): string