Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isigar/xmlparser
Nette XML parser, heureka parser
https://github.com/isigar/xmlparser
heureka nette nette-extension xml-parser
Last synced: about 5 hours ago
JSON representation
Nette XML parser, heureka parser
- Host: GitHub
- URL: https://github.com/isigar/xmlparser
- Owner: Isigar
- Created: 2018-06-26T10:39:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-12T08:52:54.000Z (about 6 years ago)
- Last Synced: 2024-04-19T19:10:12.011Z (7 months ago)
- Topics: heureka, nette, nette-extension, xml-parser
- Language: PHP
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# xmlparser
Nette XML parser, heureka parser### Setup
```
composer require relisoft/xmlparser
```> config.neon
```
extensions:
xmlparse: Relisoft\XMLParser\DI\XMLParserExtension
```### Heureka parse example
> any presenter you want```
/**
* @var Heureka
* @inject
*/
public $heureka;public function actionDefault(){
$heureka = $this->heureka;
$data = $heureka->decode(FileSystem::read('https://.../feed_heureka.xml'),'xml');
$heureka->associateData($data);
$data = $heureka->getData();
Debugger::barDump($data,"Data");
}
```#### Return:
```
0 => Relisoft\XMLParser\Entity\HeurekaProduct #9e27
id private => "1"
productname private => "Swardman Edwin Standard 55" (26)
product private => "Swardman Edwin Standard 55" (26)
description private => "Benzínová zahradní vřetenová sekačka s pojezdem.
Sekačka má záběr sečení 55 cm.
Vhodná pro trávníky s plochou do 2000 m2." (139)
categorytext private => "Heureka.cz | Dům a zahrada | Zahrada | Sekačky" (48)
url private => "https://www.swardman.com/cz/e-shop/edwin-standard-55/edwin-standard-55/" (71)
img private => "https://www.swardman.com/obj/files/7/sys_media_5769.png" (55)
price_vat private => "39999" (5)
delivery_date private => "0"
```#### Functions:
```
$heureka->decode(XML INPUT, FILE TYPE = XML)
```
> Decoded heureka xml input to array```
$heureka->associateData(DATA FROM DECODE FUNC)
```
> Associate decoded data to heureka product classes```
$heureka->getData()
```
> Get data from associate function