Download the PHP package alexsabur/yandex-realty-feed-generator without Composer
On this page you can find all versions of the php package alexsabur/yandex-realty-feed-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexsabur/yandex-realty-feed-generator
More information about alexsabur/yandex-realty-feed-generator
Files in alexsabur/yandex-realty-feed-generator
Package yandex-realty-feed-generator
Short Description YRl feed generator
License MIT
Informations about the package yandex-realty-feed-generator
Yandex Realty Language (YRL) files generator
YRLGenerator is a simple php library, which provides clean way to create files, which are used to work with yandex realty service. It is based on YRL syntax and is fully valid.
Original documentation
You can find original documentation on yandex realty feed docs website
Installation
To install, simply type in your terminal following command:
composer require alexsabur/yandex-realty-feed-generator
And make sure, that php version >= 7.3 and ext-xmlwriter is installed and enabled in your system
How to use it
The main workflow is the following:
How data must be added
To work with data, you must know, that there are three types of data presented.
- Simple data, which is presented like $key => $value and will be converted to <$key>$value</$key>
- Array data $key => $childKey => $value, which will be converted to <$key><$childKey>$value</$childKey></$key>
- Special data, like image array, which will be converted by special functions
You can use one of two available chooses to create array of data. Both of variants bellow produces equal result.
WARNING if you are using BOTH variants at the same time, values from fluent setters will overwrite data from array.
Adding data using fluent setters
If you are using most recent version, you might use fluent setters on offer object, so you have to do it like so
Adding data using arrays
So, you must create array like following: