承接 doefom/squeeze 相关项目开发

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

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

doefom/squeeze

最新稳定版本:0.2.0

Composer 安装命令:

composer require doefom/squeeze

包简介

Squeeze is a Statamic addon that provides a modifier named squeeze which removes a bunch of characters from a given string by replacing them with an empty string.

README 文档

README

Squeeze is a Statamic addon that provides a modifier named squeeze which removes a bunch of characters from a given string by replacing them with an empty string.

Features

This addon removes the following characters by default:

  • _
  • -
  • /
  • :
  • (whitespace)

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require doefom/squeeze

How to Use

In your .yaml files you probably have some kind of string variable like this:

text: "A_string-to/test:the squeeze"

Then you can use the modifier in your antlers views like this:

{{ text | squeeze }}

Which outputs:

Astringtotestthesqueeze

Options

You may also pass your own squeezables to the modifier like so:

{{ text | squeeze:":-(" }}

Important note

It's also possible to squeeze whitespaces but they cannot be the last character of the squeezables string:

{{ text | squeeze:"-_ :(" }} // This will work
{{ text | squeeze:" -_:(" }} // This will work
{{ text | squeeze:"-_:( " }} // This will not work

Also, if you want to squeeze backslashes you'll need to escape them:

{{ text | squeeze:"\\" }} // This squeezes a backslash

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固