承接 cviebrock/twig-natural-join 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

cviebrock/twig-natural-join

Composer 安装命令:

composer require cviebrock/twig-natural-join

包简介

Twig filter that joins an array using a different separator for the last element

README 文档

README

Twig filter that joins an array using a different separator for the last element (e.g. "John, Mary, Bob and Jim").

Total Downloads Latest Stable Version

Installation

The filter is registered at Packagist as cviebrock/twig-natural-join and can be installed using composer:

"require": {
	...
	"cviebrock/twig-natural-join": "0.9.*",
}

Or just download the zip file and copy the file into your src folder.

Enable the extension:

$twig = new Twig_Environment($loader, $options);
$twig->addExtension(new Cviebrock\Twig\NaturalJoinExtension());

If you are using Laravel and rcrowe/twigbridge, then enable the extension by adding an entry to the enabled array in app/config/packages/rcrowe/twigbridge/extensions.php:

'enabled' => [
	...
	'Cviebrock\Twig\NaturalJoinExtension',
],

Usage

Pass the normal seperator and final seperator to the filter:

{{ names|naturaljoin(", ", " and ") }}          // John, Bill, Bob and Mary

Optionally pass true as a third argument to turn on "Oxford" mode, which will add a normal seperator before the final seperator:

{{ names|naturaljoin(", ", " and ", true) }}    // John, Bill, Bob, and Mary

Bugs, Suggestions and Contributions

Please use Github for bugs, comments, suggestions.

  1. Fork the project.
  2. Create your bugfix/feature branch and write your (well-commented) code.
  3. Commit your changes and push to your repository.
  4. Create a new pull request against this project's master branch.

Copyright and License

twig-natural-join was written by Colin Viebrock and released under the MIT License. See the LICENSE file for details.

Copyright 2014 Colin Viebrock

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固