yml-generator An yii component that generates Yandex.Market exchange file in YML format

  1. Requirements
  2. Usage
  3. Resources

Yandex.Market YML generator. An extension for Yii framework. It supports output to a file or browser and uses XMLWriter as xml engine.

Requirements

Yii 1.1 or above

Usage

For generating xml data you need to create your own generator class and implement four methods:

  • shopInfo()
  • currencies()
  • categories()
  • offers()
class MyYmlGenerator extends YmlGenerator {

    protected function shopInfo() {...}

    protected function currencies() {...}

    protected function categories() {...}

    protected function offers() {...}
}

How to implement these metnods see YmlGenerator.php and sample class MyYmlGenerator.php

config/main.php:

'import'=>array(
        ...
        'ext.YmlGenerator.YmlGenerator',
        ...
    ),

    // application components
    'components'=>array(
        ...
        'ymlGenerator'=>array(
            'class'=>'MyYmlGenerator',
            // create file in DOCUMENT_ROOT directory
            'outputFile'=>dirname($_SERVER['SCRIPT_FILENAME']).'/catalogue.yml'
        ),
        ...
    )

Run generator:

$generator = Yii::app()->ymlGenerator;
$generator->run();

Resources

2 0
4
280
Yii Version: Unknown
License: BSD-2-Clause
Category: Others
Developed by: limion limion
Created: Dec 31, 2013
Updated: 12 years ago

Downloads

show all

Related Extensions