Download the PHP package emodric/twig-package-versions without Composer
On this page you can find all versions of the php package emodric/twig-package-versions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download emodric/twig-package-versions
More information about emodric/twig-package-versions
Files in emodric/twig-package-versions
Package twig-package-versions
Short Description Twig functions that return a package version by using jean85/pretty-package-versions library
License MIT
Homepage http://github.com/emodric/twig-package-versions
Informations about the package twig-package-versions
Package Versions Twig extension
This package provides simple Twig functions that wrap PackageVersions lib by Marco Pivetta and PrettyPackageVersions lib by Alessandro Lai making it possible to output version strings of your libraries directly inside your Twig templates.
Initially, this Twig extension was submitted as a pull request against official Twig Extensions collection, but was turned into a separate package since no new features are accepted over there.
Installation
To install this extension, use Composer:
composer require emodric/twig-package-versions
Using the extension
In PHP:
In a Symfony project, you can register the extension as a service:
Once set up, you can use the following Twig functions:
package_version('my-vendor/package-name')
- Returns the package version string as returned byPackageVersions\Versions::getVersion
methodpretty_package_version('my-vendor/package-name')
- Returns theJean85\Version
object as returned byJean85\PrettyVersions::getVersion
method