public function post($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_configure'); // 保存数据 ShopThemePlugin::saveOptionValue('head_nav_json_data', json_encode($f3->get('POST[headNav]'))); // 清除 所有页面 $shopClear = new ShopClear(); $shopClear->clearAllCache(); $this->addFlashMessage('保存设置成功'); RouteHelper::reRoute($this, '/Theme/Shop/HeadNav'); }
public function post($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_configure'); // 参数验证 $validator = new Validator($f3->get('POST')); foreach ($this->optionKeyArray as $optionKey) { if (in_array($optionKey, $this->optionKeyNoFilterArray)) { $optionValue = $f3->get('POST[' . $optionKey . ']'); } else { $optionValue = $validator->validate($optionKey); } ShopThemePlugin::saveOptionValue($optionKey, $optionValue); } // 清除 /Shop/Index 页面 $shopClear = new ShopClear(); $shopClear->clearAllCache(); $this->addFlashMessage('保存设置成功'); out_display: global $smarty; $smarty->display('theme_shop_basic.tpl', 'post'); }
public function post($f3) { // 权限检查 $this->requirePrivilege('manage_plugin_theme_adv_configure'); // 参数验证 $validator = new Validator($f3->get('POST')); // slider 广告设置 $imageArray = $validator->validate('image'); $urlArray = $validator->validate('url'); $targetArray = $validator->validate('target'); $imageSize = is_array($imageArray) ? count($imageArray) : 0; $goods_view_adv_slider = array(); // 组织数据结构 for ($index = 0; $index < $imageSize; $index++) { $goods_view_adv_slider[] = array('image' => $imageArray[$index], 'url' => $urlArray[$index], 'target' => $targetArray[$index]); } ShopThemePlugin::saveOptionValue('goods_view_adv_slider', json_encode($goods_view_adv_slider)); // 清除搜索页面的缓存 $shopClear = new ShopClear(); $shopClear->clearAllCache(); $this->addFlashMessage('保存设置成功'); RouteHelper::reRoute($this, '/Theme/Shop/GoodsViewSlider'); }