1.appfront:
@fecyo\app\appfront\modules\Cms\block\home\Index.php
public function getLastData()
{
$this->initHead();
$hot_product_skus = Yii::$app->store->get('fecyo_info', 'hot_product_skus');
$chaoliu_s_skus_1 = Yii::$app->store->get('fecyo_info', 'chaoliu_s_skus_1');
$chaoliu_s_skus_2 = Yii::$app->store->get('fecyo_info', 'chaoliu_s_skus_2');
$chaoliu_x_skus_1 = Yii::$app->store->get('fecyo_info', 'chaoliu_x_skus_1');
$chaoliu_x_skus_2 = Yii::$app->store->get('fecyo_info', 'chaoliu_x_skus_2');
$new_product_skus = Yii::$app->store->get('fecyo_info', 'new_product_skus');
$hot_product_sku_arr = $this->getConfigArr($hot_product_skus);
$chaoliu_s_sku_1_arr = $this->getConfigArr($chaoliu_s_skus_1);
$chaoliu_s_sku_2_arr = $this->getConfigArr($chaoliu_s_skus_2);
$chaoliu_x_sku_1_arr = $this->getConfigArr($chaoliu_x_skus_1);
$chaoliu_x_sku_2_arr = $this->getConfigArr($chaoliu_x_skus_2);
$new_product_sku_arr = $this->getConfigArr($new_product_skus);
return [
'hot_products' => $this->getProductBySkus($hot_product_sku_arr),
'chaoliu_s1_products' => $this->getProductBySkus($chaoliu_s_sku_1_arr),
'chaoliu_s2_products' => $this->getProductBySkus($chaoliu_s_sku_2_arr),
'chaoliu_x1_products' => $this->getProductBySkus($chaoliu_x_sku_1_arr),
'chaoliu_x2_products' => $this->getProductBySkus($chaoliu_x_sku_2_arr),
'new_products' => $this->getProductBySkus($new_product_sku_arr),
];
}
hot_products是这里返回的,这个数组里面的参数,就是view里面的变量
2.html5部分,fecyo没有重写cms/home/index,您可以用这里的参数:https://github.com/fecshop/yii2_fecshop/blob/master/app/apphtml5/modules/Cms/block/home/Index.php#L20
或者自己重写