承接 roksta/punctuator 相关项目开发

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

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

roksta/punctuator

Composer 安装命令:

composer require roksta/punctuator

包简介

very simple punctuation for texts.

README 文档

README

A simple punctuator for texts. Adds spaces after punctuation marks and formats texts.

How It Works

It is just a simple script that accespts a string and inspects it so that: The text begins with an uppercase character. After every fullstop(.) or question mark(?), there is a space and the next work begins with an uppercase character. After every comma(,), there is a space.

It is especially useful for formating user input before saving them to the database. It takes advantage of Laravel's model listeners through a Spacer.php trait.

Usage

use Roksta\Punctuator\Spacer;

class MyModel extends Model
{
    use Spacer;
    /**
    * set the columns you wish to punctuate in an array in the form shown below;
    * short defines columns where each word is to begin with an uppercase letter, eg, names, locations, etc
    * long is for sentences where spaces will be added after every comma, fullstop, etc.
    */
    public function setPunctuateColumns(): Array
    {
        return ['short' => ['name'], 'long' => ['description', 'comments']];
    }
    
    // Other model functions
}

Results

sam roksta = Sam Roksta

this is very simple.really,really simple = This is very simple. Really, really simple.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固