asgoodasnu/version-bundle

提供版本控制的包

此包的规范存储库似乎已丢失,因此已冻结该包。

安装数: 1,049

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 25

分支: 0

开放性问题: 0

类型:symfony-bundle

v0.1.3 2016-01-08 11:25 UTC

This package is not auto-updated.

Last update: 2019-12-09 03:35:21 UTC


README

Build Status Total Downloads Latest Stable Version SensioLabsInsight

安装

通过composer安装

composer.phar require asgoodasnu/version-bundle

AppKernel.php中注册您的包

public function registerBundles()
{
    $bundles = array(
        // ...
        new Wk\VersionBundle\WkVersionBundle(),
        // ...
    );

    return $bundles;
}

如果您想使用REST API,请将以下内容添加到app/config/routing.yml

_version:
    resource: "@WkVersionBundle/Resources/config/routing.yml"

配置

将以下参数放入您的app/config/parameters.yml

version: 1.0.0

如果有新版本部署,请更新此值

使用

现在您可以通过REST API检索您应用程序的版本号

curl http://your-project.org/version.json

要将此版本号用于twig模板,请将其放入app/config/config.yml

twig:
    # ...
    globals:
        version: "%version%" 

然后您可以这样使用它

<p>The version number is: {{ version }}</p>