PHP code example of uzdevid / converter

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

    

uzdevid / converter example snippets


use Yiisoft\Hydrator\Hydrator;
use UzDevid\Converter\Converter;

$hydrator = new Hydrator();
$converter = new Converter($hydrator);

$converter->convert(CarDto::class, $carModel);

use Yiisoft\Hydrator\Hydrator;
use UzDevid\Converter\Converter;

$hydrator = new Hydrator();
$converter = new Converter($hydrator);

$converter->convert(CarDto::class, ['name' => 'Ferrari']);