PHP code example of professionalweb / yml-generator

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

    

professionalweb / yml-generator example snippets




use Bukashk0zzz\YmlGenerator\Model\Offer\OfferSimple;
use Bukashk0zzz\YmlGenerator\Model\Category;
use Bukashk0zzz\YmlGenerator\Model\Currency;
use Bukashk0zzz\YmlGenerator\Model\ShopInfo;
use Bukashk0zzz\YmlGenerator\Settings;
use Bukashk0zzz\YmlGenerator\Generator;

$file = tempnam(sys_get_temp_dir(), 'YMLGenerator');
$settings = (new Settings())
    ->setOutputFile($file)
;

// Creating ShopInfo object (https://yandex.ru/support/webmaster/goods-prices/technical-tegories = [];
$categories[] = (new Category())
    ->setId(1)
    ->setName($this->faker->name)
;

// Creating offers array (https://yandex.ru/support/webmaster/goods-prices/technical-