Download the PHP package tleckie/versioned-assets without Composer
On this page you can find all versions of the php package tleckie/versioned-assets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tleckie/versioned-assets
More information about tleckie/versioned-assets
Files in tleckie/versioned-assets
Package versioned-assets
Short Description Moving asset locations is cumbersome and error prone it requires you to carefully update the URLs of all assets included in all templates. The asset component allows you to have full control of the paths of your resources in an orderly way that is easy to maintain.
License MIT
Homepage https://github.com/teodoroleckie/versioned-assets
Informations about the package versioned-assets
versioned-assets
Fast and powerful php versioned-assets engine
Installation
You can install the package via composer:
Moving asset locations is cumbersome and error, prone - it requires you to carefully update the URLs of all assets included in all templates. The asset component allows you to have full control of the paths of your resources in an orderly way that is easy to maintain.
Usage
You can also customize the format of your version by adding the second parameter to which a sprintf will be applied:
If you need to include your assets to have a domain, you simply need to include the domain as the value of the path argument: When configuring a domain as a path, the resources included as relative and absolute will have the same result
You can also use NullVersioned if you want to disable versioning for your assets.
A popular strategy to manage asset versioning, which is used by tools such as Webpack, is to generate a JSON file mapping all source file names to their corresponding output file:
Custom versioning:
You can create your custom versioning class by implementing the VersionedInterface interface.
That's all! I hope this helps you ;)