1. Go to this page and download the library: Download kariricode/transformer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use KaririCode\Transformer\Processor\Data\NumberTransformer;
$numberTransformer = new NumberTransformer();
$numberTransformer->configure([
'decimals' => 2,
'decimalPoint' => ',',
'thousandsSeparator' => '.',
]);
$registry->register('transformer', 'number', $numberTransformer);
$registry = new ProcessorRegistry();
// Register String Transformers
$registry->register('transformer', 'case', new CaseTransformer())
->register('transformer', 'mask', new MaskTransformer())
->register('transformer', 'slug', new SlugTransformer())
->register('transformer', 'template', new TemplateTransformer());
// Register Data Transformers
$registry->register('transformer', 'date', new DateTransformer())
->register('transformer', 'number', new NumberTransformer())
->register('transformer', 'json', new JsonTransformer());
// Register Array Transformers
$registry->register('transformer', 'arrayFlat', new ArrayFlattenTransformer())
->register('transformer', 'arrayGroup', new ArrayGroupTransformer())
->register('transformer', 'arrayKey', new ArrayKeyTransformer())
->register('transformer', 'arrayMap', new ArrayMapTransformer());
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.