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();
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.