PHP code example of dmskys / dcat-sku-plus

1. Go to this page and download the library: Download dmskys/dcat-sku-plus 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/ */

    

dmskys / dcat-sku-plus example snippets



        $skuParams = [
            // 扩展第一列
            [
                'name'    => '会员价', // table 第一行 title
                'field'   => 'member_price', // input 的 field_name 名称
                'default' => 5, // 默认值
            ],
            // 扩展第二列
        ];
        //
        $form->sku('sku', '生成SKU')->init([
			[
				'id'=>1,
				'attr_name'=>'size',
				'attr_type'=>'checkbox',//checkbox|radio
				'attr_value'=>["S","M","L"],
				'sort'=>1,
			],
		    [
			    'id'=>2,
			    'attr_name'=>'color',
			    'attr_type'=>'checkbox',
			    'attr_value'=>["S","M","L"],
			    'sort'=>1,
		    ]
	    ],$skuParams);