Convert strings to different case formats. Pascal, title, camel, underscore.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DependencyInjection
Resources
Tests
Twig/Extension
Util
.gitignore
.travis.yml
AvroCaseBundle.php
README.md
composer.json
phpunit.xml.dist

README.md

AvroCaseBundle Build Status

Convert strings or an array of strings to different case formats.

Supports: camelCase, PascalCase, Title Case, and underscore_case.

Installation

This bundle is listed on packagist.

Simply add it to your apps composer.json file

    "avro/case-bundle": "0.1.2"

Enable the bundle in the kernel:

// app/AppKernel.php

    new Avro\CaseBundle\AvroCaseBundle

Configuration

avro_case:
    use_twig: false #disable the twig extension (true by default)

Usage

$converter = $this->container->get('avro_case.converter');

$camelCaseFormat = $converter->toCamelCase($str);
$pascalCaseFormat = $converter->toPascalCase($str);
$titleCaseFormat = $converter->toTitleCase($str);
$underscoreCaseFormat = $converter->toUnderscoreCase($str);

The following filters are also available if you use Twig

    {{ var | camel }}
    {{ var | pascal }}
    {{ var | title }}
    {{ var | underscore }}