Asset Helpers

Asset helpers are specialized template tags made for bundling and caching styles and scripts.

Link

Initialize the collection:

Tag::link()->init(string $name);

Append a tag to the collection:

Tag::link()->append(mixed $attribute, string $value);
Tag::link()->appendFile(string $file);

Prepend a tag to the collection:

Tag::link()->prepend(mixed $attribute, string $value);
Tag::link()->prependFile(string $file);

Remove a tag from the collection:

Tag::link()->remove(mixed $attribute, string $value);
Tag::link()->removeFile(string $file);

Rewrite paths in the collection:

Tag::link()->rewrite(array rewriteArray);

Concat the collection to a cached file:

Tag::link()->concat(array $optionArray);

Clear the collection:

Tag::link()->clear();

Style

Initialize the collection:

Tag::style()->init(string $name);

Append inline code to the collection:

Tag::style()->appendInline(string $inline);

Prepend inline code to the collection:

Tag::style()->prependInline(string $inline);

Clear the collection:

Tag::link()->clear();

Script

Initialize the collection:

Tag::script()->init(string $name);

Append a tag to the collection:

Tag::script()->append(mixed $attribute, string $value);
Tag::script()->appendFile(string $file);

Append inline code to the collection:

Tag::script()->appendInline(string $inline);

Prepend a tag to the collection:

Tag::script()->prepend(mixed $attribute, string $value);
Tag::script()->prependFile(string $file);

Prepend inline code to the collection:

Tag::script()->prependInline(string $inline);

Remove a tag from the collection:

Tag::script()->remove(mixed $attribute, string $value);
Tag::script()->removeFile(string $file);

Transport PHP to JavaScript variables:

Tag::script()->transportVar(string $key, mixed $value);

Concat the collection to a cached file:

Tag::script()->concat(array $optionArray);

Clear the collection:

Tag::script()->clear();
Edit on GitHub