Exemple #1
0
    $f3->set('ONERROR', function ($f3) {
        /**
         * Information about the last HTTP error that occurred.
         * ERROR.code is the HTTP status code.
         * ERROR.title contains a brief description of the error.
         * ERROR.text provides greater detail. For HTTP 500 errors, use ERROR.trace to retrieve the stack trace.
         */
        $code = $f3->get('ERROR.code');
        RouteHelper::reRoute(null, '/');
    });
}
// ---------------------------------------- 4. 加载显示主题 --------------------------------------
// 为 Manage 设置网站的 WebRootBase,这样在 Manage 中就可以对相应网站做操作
$systemUrlBase = ManageThemePlugin::getSystemUrlBase(PluginHelper::SYSTEM_MOBILE);
if (empty($systemUrlBase) || $systemUrlBase['base'] != $f3->get('sysConfig[webroot_url_prefix]')) {
    ManageThemePlugin::saveSystemUrlBase(PluginHelper::SYSTEM_MOBILE, '移动', '棒主妇移动端网站', $f3->get('sysConfig[webroot_url_prefix]'));
}
$themeIntance = ThemeHelper::loadSystemTheme(ThemeHelper::SYSTEM_MOBILE_THEME);
if (!$themeIntance) {
    die('没有正确设置 ' . ThemeHelper::SYSTEM_MOBILE_THEME . ' 主题');
}
// 调用主题自己的初始化方法
$themeLoadRet = $themeIntance->pluginLoad(PluginHelper::SYSTEM_MOBILE);
if (true !== $themeLoadRet) {
    die(ThemeHelper::SYSTEM_MOBILE_THEME . ' 主题无法初始化:' . $themeLoadRet);
}
// 调用主题的 action
$themeActionRet = $themeIntance->pluginAction(PluginHelper::SYSTEM_MOBILE);
if (true !== $themeActionRet) {
    die(ThemeHelper::SYSTEM_MOBILE_THEME . ' 主题无法加载:' . $themeActionRet);
}
Exemple #2
0
         * ERROR.title contains a brief description of the error.
         * ERROR.text provides greater detail. For HTTP 500 errors, use ERROR.trace to retrieve the stack trace.
         */
        $code = $f3->get('ERROR.code');
        if (404 == intval($code)) {
            RouteHelper::reRoute(null, '/Error/E404?url=' . urlencode(RouteHelper::getFullURL()));
        } else {
            RouteHelper::reRoute(null, '/');
        }
    });
}
// ---------------------------------------- 4. 加载显示主题 -----------------------------------
// 为 Manage 设置网站的 WebRootBase,这样在 Manage 中就可以对相应网站做操作
$systemUrlBase = ManageThemePlugin::getSystemUrlBase(PluginHelper::SYSTEM_SHOP);
if (empty($systemUrlBase) || $systemUrlBase['base'] != $f3->get('sysConfig[webroot_url_prefix]')) {
    ManageThemePlugin::saveSystemUrlBase(PluginHelper::SYSTEM_SHOP, '商城', '棒主妇商城', $f3->get('sysConfig[webroot_url_prefix]'));
}
$themeIntance = ThemeHelper::loadSystemTheme(ThemeHelper::SYSTEM_SHOP_THEME);
if (!$themeIntance) {
    die('没有正确设置 ' . ThemeHelper::SYSTEM_SHOP_THEME . ' 主题');
}
// 调用主题自己的初始化方法
$themeLoadRet = $themeIntance->pluginLoad(PluginHelper::SYSTEM_SHOP);
if (true !== $themeLoadRet) {
    die(ThemeHelper::SYSTEM_SHOP_THEME . ' 主题无法初始化:' . $themeLoadRet);
}
// 调用主题的 action
$themeActionRet = $themeIntance->pluginAction(PluginHelper::SYSTEM_SHOP);
if (true !== $themeActionRet) {
    die(ThemeHelper::SYSTEM_SHOP_THEME . ' 主题无法加载:' . $themeActionRet);
}