PHP code example of zpearl / yii2-shop
1. Go to this page and download the library: Download zpearl/yii2-shop library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zpearl / yii2-shop example snippets
php yii migrate --migrationPath=vendor/pistol88/yii2-shop/migrations
'modules' => [
//..
'shop' => [
'class' => 'zpearl\shop\Module',
'adminRoles' => ['administrator'],
],
'filter' => [
'class' => 'pistol88\filter\Module',
'adminRoles' => ['administrator'],
'relationModel' => 'zpearl\shop\models\Product',
'relationFieldName' => 'category_id',
'relationFieldValues' =>
function() {
return \zpearl\shop\models\buldTextTree();
},
],
'field' => [
'class' => 'pistol88\field\Module',
'relationModels' => [
'zpearl\shop\models\Product' => 'Продукты',
'zpearl\shop\models\Category' => 'Категории',
'zpearl\shop\models\Producer' => 'Производители',
],
'adminRoles' => ['administrator'],
],
'relations' => [
'class' => 'pistol88\relations\Module',
'fields' => ['code'],
],
'gallery' => [
'class' => 'pistol88\gallery\Module',
'imagesStorePath' => dirname(dirname(__DIR__)).'/storage/web/images/store',
'imagesCachePath' => dirname(dirname(__DIR__)).'/storage/web/images/cache',
'graphicsLibrary' => 'GD',
'placeHolderPath' => dirname(dirname(__DIR__)).'/storage/web/images/placeHolder.png',
],
//..
]
'components' => [
//..
'fileStorage' => [
'class' => '\trntv\filekit\Storage',
'baseUrl' => '@storageUrl/source',
'filesystem'=> function() {
$adapter = new \League\Flysystem\Adapter\Local(dirname(dirname(__DIR__)).'/frontend/web/images/source');
return new League\Flysystem\Filesystem($adapter);
},
],
//..
]