1. Go to this page and download the library: Download biig/optimus 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/ */
biig / optimus example snippets
namespace Transformer;
use Biig\Optimus\AbstractMappingTransformer;
use Symfony\Component\Yaml\Yaml;
class MyTransformer extends AbstractMappingTransformer
{
/**
* {@inheritdoc}
*/
protected function transform(array $inputArray)
{
$config = Yaml::parseFile('/mapping.yaml');
$result = $this->transformFromMapping($config['transformer']['mapping'], $inputArray);
// ...
return $result;
}
}