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 followers
280 downloads
Yii Version: Unknown
License: BSD-2-Clause
Category: Others
Developed by: limion
Created on: Dec 31, 2013
Last updated: 4 years ago

Downloads

show all

Related Extensions