定制 emodric/twig-package-versions 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

emodric/twig-package-versions

最新稳定版本:2.0.0

Composer 安装命令:

composer require emodric/twig-package-versions

包简介

Twig functions that return a package version by using jean85/pretty-package-versions library

README 文档

README

This package provides simple Twig functions that wrap 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:

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

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

In a Symfony project, you can register the extension as a service:

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

Once set up, you can use the following Twig functions:

  • package_version('my-vendor/package-name') - Returns the full package version string
  • pretty_package_version('my-vendor/package-name') - Returns pretty package version string

统计信息

  • 总下载量: 106.24k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 3
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固