jasonroman/twig-extension-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jasonroman/twig-extension-bundle

最新稳定版本:1.0.3

Composer 安装命令:

composer require jasonroman/twig-extension-bundle

包简介

Jason Roman's Twig Extension Bundle for Symfony2

README 文档

README

Build Status

This is a class that contains Twig filters. There are 5 filters:

  • phone - displays a phone number in a specified format
  • price - essentially a PHP number_format() clone that adds '$' to the front
  • boolean - returns 'Yes'/'No' (or custom text) based on the boolean value of the variable
  • md5 - displays the md5 hash of the passed-in value
  • timeAgo - converts a time to time 'ago', such as 5 days ago, 27 seconds ago, 2 years ago

Installation

Add the bundle to your composer.json

{
    "require": {
        "jasonroman/twig-extension-bundle": "1.0.*@dev"
    }
}

Register the bundle in app/AppKernel.php

$bundles = array(
    // ...
    new JasonRoman\Bundle\TwigExtensionBundle\JasonRomanTwigExtensionBundle(),
);

Usage

{{ somePhone|phone }}
{{ someCurrency|price }}
{{ someValue|boolean }}
{{ someString|md5 }}
{{ someDate|timeAgo }}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-04-14