Yandex.Market YML generator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Yandex.Market YML generator. An extension for Yii framework.

It supports output to a file or browser and uses XMLWriter as xml engine.

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

  • shopInfo()
  • currencies()
  • categories()
  • offers()

For example:

Your config/main.php:


// application components
        // create file in DOCUMENT_ROOT directory

Your component file:

class MyYmlGenerator extends YmlGenerator {

protected function shopInfo() {
  return array(

protected function currencies() {

  $currencies = ...;
  foreach($currencies as $currecy) {

protected function categories() {
  $categories = ...;
  foreach($categories as $category) {

  protected function offers() {
    $offers = ...;
    foreach($offers as $offer) {
      $this->addOffer($id,$data, $params, $available, $type, $bid, $cbid);


Run generator:

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

Description of add* methods you can find in YmlGenerator.php.

More about YML see: