定制 salernolabs/camelize 二次开发

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

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

salernolabs/camelize

最新稳定版本:v1.0.0

Composer 安装命令:

composer require salernolabs/camelize

包简介

Utility for camel and uncamel casing words or phrases.

README 文档

README

Latest Stable Version License Build Status

Simple library to perform camel and uncamel casing of words or phrases. The library is designed to by multibyte character safe. PHPUnit tests are included.

Not sure just how useful this is as a library but I've used it for some code modification processes in the past.

Usage

First include the library with composer.

composer require salernolabs/camelize

Camel Casing

The camel casing utility assumes your input string is hungarian notation, or something similar. To camel case something, try this:

$camelizer = new \SalernoLabs\Camelize\Camel();

$output = $camelizer->camelize('some_text_in_some_notation');

echo $output;

This should output "SomeTextInSomeNotation". You can also do:

//Defaults to true
$camelizer->setShouldCapitalizeFirstCharacter(false);

And the resulting output would be "someTextInSomeNotation".

Uncamel Casing

The uncamel casing utility assumes your input string is already in Camel Case notation. To uncamelize something, try this:

$uncamelizer = new \SalernoLabs\Camelize\Uncamel();

$output = $uncamelizer->uncamelize('SomeTextInCamelCase');

echo $output;

This should output "some_text_in_camel_case" (snake case). You can also do:

//Defaults to false
$uncamelizer->setShouldCapitalizeFirstCharacter(true);

And the resulting output would be "Some_Text_In_Camel_Case".

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固