PHP code example of smichaelsen / caldera-php

1. Go to this page and download the library: Download smichaelsen/caldera-php 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/ */

    

smichaelsen / caldera-php example snippets


$csvInputGenerator = new \Smichaelsen\Caldera\InputGenerator\CsvInputGenerator();
$csvInputGenerator->setCsvHandle(fopen(__DIR__ . '/test-equestrian.csv', 'r'));

foreach (\Smichaelsen\Caldera\RecordMapper::mapRecords(
    $csvInputGenerator,
    new MyMappingClass()
) as $record) {
    // $record is mapped, validated and processed according to rules in your MyMappingClass() 
}

composer update --prefer-lowest --prefer-stable
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests
composer update
./vendor/bin/phpunit --bootstrap vendor/autoload.php tests