/AssetsList

A helper class to manage assets in your website

Primary LanguagePHP

AssetsList

2016-12-28 -> 2021-03-05

A helper class to manage assets in your website.

AssetsList is part of the universe framework.

Install

Using the planet installer via light-cli

lt install Ling.AssetsList

Using the uni tool

uni import Ling/AssetsList

How does it work?

There are two phases:

  • registering the calls
  • displaying the assets

Registering the calls

To register a call, you call the js or the css method.

AssetsList is a static class with static methods, so you can call an asset from anywhere.

AssetsList::js("/libs/mylibs/dorothy.js");

If it's a library that should only be called once, pass the name of the library as the second argument. Every subsequent call to the same library will be ignored.

AssetsList::js("/libs/jquery/jquery.min.js", "jquery");

Displaying the assets

When you are done collecting the assets, you need to display them.

Inside your html head, call the displayList method.

AssetsList::displayList();

Dependencies

History Log

  • 1.0.3 -- 2021-03-05

    • update README.md, add install alternative
  • 1.0.2 -- 2020-12-08

    • Fix lpi-deps not using natsort.
  • 1.0.1 -- 2020-12-04

    • Add lpi-deps.byml file
  • 1.0.0 -- 2016-12-28

    • initial commit