jawira/case-converter-twig
最新稳定版本:v1.0.1
Composer 安装命令:
composer require jawira/case-converter-twig
包简介
🔤 Twig extension for Case Converter
README 文档
README
This Twig extension is port from jawira/case-converter.
Usage
This library provides the following filters:
| from_ | to_ |
|---|---|
from_auto |
|
from_ada |
to_ada |
from_camel |
to_camel |
from_cobol |
to_cobol |
from_dot |
to_dot |
from_kebab |
to_kebab |
from_lower |
to_lower |
from_macro |
to_macro |
from_pascal |
to_pascal |
from_sentence |
to_sentence |
from_snake |
to_snake |
from_title |
to_title |
from_train |
to_train |
from_uppder |
to_upper |
Use a to_* filter to automatically change the
casing convention of a string:
{{ 'welcome-to-the-jungle'|to_camel }}
{# outputs 'welcomeToTheJungle' #}
Optionally, you can call a from_* filter to specify the casing convention of input string:
{{ 'user.first-name'|from_dot|to_upper }}
{# outputs 'USER FIRST-NAME' #}
How to install
Install with Composer:
$ composer require jawira/case-converter-twig
If you are not using Symfony Flex, you also have to register the extension:
# config/packages/case_converter_twig.yaml services: jawira.case.converter.twig: class: \Jawira\CaseConverterTwig\CaseConverterExtension tags: [ 'twig.extension' ]
Contributing
If you liked this project, ⭐ star it on GitHub.
License
This library is licensed under the MIT license.
Packages from jawira
-
jawira/case-converter
- Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.
-
jawira/emoji-catalog
- Get access to +3000 emojis as class constants.
- more...
统计信息
- 总下载量: 14.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-02