techwilk/twig-linewrap 问题修复 & 功能扩展

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

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

techwilk/twig-linewrap

Composer 安装命令:

composer require techwilk/twig-linewrap

包简介

TWIG filter to wrap lines exceeding the specified length.

README 文档

README

Total Downloads Latest Stable Version License

TWIG filter to wrap lines over a specified length with a newline, or optionally pass in a different separator.

Designed for wrapping iCal files to 75 chars max length, although should be useful in any application requiring line wrapping.

Installation

  1. Install through composer.
composer require techwilk/twig-linewrap
  1. Then add as an extension to TWIG:
$twig->addExtension(new \TechWilk\Twig\Extension\LineWrap());

Use

Use as a standard twig filter, passing in a maximum length after which to wrap:

{{ 'this is some text that goes on forever' | linewrap(10) }}

outputs:

this is so
me text th
at goes on
 forever

Optionally pass in a different separator (such as for iCal wrapping):

{{ 'this is some text that goes on forever' | linewrap(75, "\n ") }}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固