craft-group / sima-land-api
Simple wrapper for www.sima-land.ru/api
dev-master
2019-09-30 15:25 UTC
Requires
- php: >=7.0.0
- ext-curl: *
- craft-group/sima-land-api: dev-master
This package is auto-updated.
Last update: 2021-12-29 03:23:29 UTC
README
Simple wrapper for www.sima-land.ru/api
How to get json for first page of category:
print_r(Wrapper::runFor(IUrls::Category) ->getPage(1) ->getJson());
How to get all links for first page of category:
print_r(Wrapper::runFor(IUrls::Category) ->getPage(1) ->getLinksFromJson());
How to get total count of pages of category:
print_r(Wrapper::runFor(IUrls::Category) ->getPage(1) ->getMetaFromJson()->pageCount);
How to get href to last page of category:
print_r(Wrapper::runFor(IUrls::Category) ->getPage(1) ->getLinksFromJson()->last);
How to run custom query and get array of CategoryItems from it:
$data = array( 'path'=>'2', 'level'=>'2'); print_r(Wrapper::runFor(IUrls::Category) ->query($data)->getItemFromJson()
How to get array of all most liked goods items:
print_r(Wrapper::runFor(IUrls::GoodsMostLiked) ->getPage(1)->getItemFromJson() );
How to get all name of categories in custom query:
foreach (Wrapper::runFor(IUrls::Category) ->getPage(1)->getItemFromJson() as $item) echo $item->name . "\n";