public function render() { $this->masterView->setAuth($this->authController->render()); switch ($this->router->getCurrentPath()) { case Router::INDEX: $this->masterView->setMain($this->inputController->render()); break; case Router::MY_DIAGRAMS: if ($this->auth->isLoggedIn()) { $this->masterView->setMain($this->myDiagramsController->render()); } else { $this->router->redirectTo(Router::INDEX); return null; } break; case Router::REGISTER: $this->masterView->setMain($this->authController->register()); break; case Router::FILE: return $this->fileController->render(); default: if ($this->router->isDiagram()) { $this->masterView->setMain($this->inputController->render()); } else { $this->router->redirectTo(Router::INDEX); return null; } } return $this->masterView->render(); }
public function beforeRoute($f3) { parent::beforeRoute($f3); // 发布我们自己的资源 ManagerHelper::publishAsset(ShopThemePlugin::pluginGetUniqueId(), 'css'); ManagerHelper::publishAsset(ShopThemePlugin::pluginGetUniqueId(), 'js'); ManagerHelper::publishAsset(ShopThemePlugin::pluginGetUniqueId(), 'img'); // 插件注册 css, js ManagerHelper::registerCss(ManagerHelper::getAssetUrl(ShopThemePlugin::pluginGetUniqueId(), 'css/theme_shop.css')); ManagerHelper::registerCss(ManagerHelper::getAssetUrl(ShopThemePlugin::pluginGetUniqueId(), 'css/advblock.css')); ManagerHelper::registerJs(ManagerHelper::getAssetUrl(ShopThemePlugin::pluginGetUniqueId(), 'js/theme_shop.js')); // 注册自己使用的 smarty 函数 theme_shop_smarty_register(); }