定制 fyre/inflector 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

fyre/inflector

Composer 安装命令:

composer require fyre/inflector

包简介

An inflection library.

README 文档

README

FyreInflector is a free, open-source inflection library for PHP.

Table Of Contents

Installation

Using Composer

composer require fyre/inflector

In PHP:

use Fyre\Utility\Inflector;

Basic Usage

$inflector = new Inflector();

Methods

Camelize

Convert a delimited string into CamelCase.

  • $string is the input string.
  • $delimiter is a string representing the delimiter, and will default to "_".
$camelized = $inflector->camelize($string, $delimiter);

Classify

Convert a table_name to a singular ClassName.

  • $tableName is a string representing the table name.
$className = $inflector->classify($tableName);

Dasherize

Convert a string into kebab-case.

  • $string is the input string.
$dasherized = $inflector->dasherize($string);

Humanize

Convert a delimited string into Human Readable Form.

  • $string is the input string.
  • $delimiter is a string representing the delimiter, and will default to "_".
$title = $inflector->humanize($string, $delimiter);

Pluralize

Get the plural form of a word.

  • $string is the input string.
$plural = $inflector->pluralize($string);

Rules

Add inflection rules.

  • $type is a string representing the inflection type, and must be one of either "plural", "singular", "irregular" or "uncountable".
  • $rules is an array containing the rules to add.
$inflector->rules($type, $rules);

Singularize

Get the singular form of a word.

  • $string is the input string.
$singular = $inflector->singularize($string);

Tableize

Convert a ClassName to a pluralized table_name.

  • $className is a string representing the class name.
$tableName = $inflector->tableize($className);

Underscore

Convert a string into snake_case.

  • $string is the input string.
$underscored = $inflector->underscore($string);

Variable

Convert a delimited string into camelBack.

  • $string is the input string.
$variable = $inflector->variable($string);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-10-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固