misatotremor/case-bundle
最新稳定版本:v1.2.1
Composer 安装命令:
composer require misatotremor/case-bundle
包简介
Symfony Case Converter Bundle
README 文档
README
Convert strings or strings in arrays to different case formats.
Supports: camelCase, PascalCase, Title Case, and underscore_case.
This is a fork of jdewits original code.
Installation
This bundle is listed on packagist.
Download the bundle
$ composer require misatotremor/case-bundle
Enable the bundle
<?php // config/bundles.php return [ // ... Avro\CaseBundle\AvroCaseBundle::class => ['all' => true], // ... ];
Configuration
Optional: Add this config
# config/packages/avro_case.yaml avro_case: use_twig: false #disable the twig extension (true by default)
Usage
<?php use Avro\CaseBundle\Util\CaseConverter; class SomeClass { private $caseConverter; /** * @param CaseConverter $caseConverter */ public function __construct(CaseConverter $caseConverter) { $this->caseConverter = $caseConverter; } /** * @param string $str */ public function foo(string $str) { $camelCaseFormat = $this->converter->toCamelCase($str); $pascalCaseFormat = $this->converter->toPascalCase($str); $titleCaseFormat = $this->converter->toTitleCase($str); $underscoreCaseFormat = $this->converter->toUnderscoreCase($str); } }
The following filters are also available if you use Twig
{{ var | camel }}
{{ var | pascal }}
{{ var | title }}
{{ var | underscore }}
统计信息
- 总下载量: 7.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-17