2017 © Pedro Peláez
 

library twig-package-versions

Twig functions that return a package version by using PackageVersions library by Marco Pivetta

image

emodric/twig-package-versions

Twig functions that return a package version by using PackageVersions library by Marco Pivetta

  • Monday, June 11, 2018
  • by emodric
  • Repository
  • 1 Watchers
  • 0 Stars
  • 126 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 12500 % Grown

The README.md

Package Versions Twig extension

Build Status Downloads Latest stable License, (*1)

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., (*2)

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., (*3)

Installation

To install this extension, use Composer:, (*4)

composer require emodric/twig-package-versions

Using the extension

In PHP:, (*5)

$twig = new \Twig\Environment($loader, $options);

$twig->addExtension(new \EdiModric\Twig\VersionExtension());

In a Symfony project, you can register the extension as a service:, (*6)

services:
    twig.extension.version:
        class: EdiModric\Twig\VersionExtension
        tags:
            - { name: twig.extension }

Once set up, you can use the following Twig functions:, (*7)

  • package_version('my-vendor/package-name') - Returns the package version string as returned by PackageVersions\Versions::getVersion method
  • pretty_package_version('my-vendor/package-name') - Returns the Jean85\Version object as returned by Jean85\PrettyVersions::getVersion method

The Versions

11/06 2018

dev-master

9999999-dev http://github.com/emodric/twig-package-versions

Twig functions that return a package version by using PackageVersions library by Marco Pivetta

  Sources   Download

MIT

The Requires

 

The Development Requires

templating twig symfony package version

22/05 2018

1.0.0

1.0.0.0 http://github.com/emodric/twig-package-versions

Twig functions that return a package version by using PackageVersions library by Marco Pivetta

  Sources   Download

MIT

The Requires

 

The Development Requires

templating twig package version