多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 路由配置文件(CMS路由): route\route_cms.php > 1.修改后台入口:对应默认后台入口地址 http://domain/madmin/ 修改路由配置中madmin为任意字符即可 `Route::rule('madmin', 'admin/index/login');` > 2.tag标签列表页(对应url:tag/标签名称/页码/) > 标签名称:(必须)对应tags表的tag标签名称 > 页码:(非必须)指定页(数字) `Route::rule('tag/[:tag]/[:page]/', 'cms/index/tags');` > 3.搜索关键词列表页(对应url: search/关键词/modelid/模型ID/时间范围/页码/) > 关键词:(必须)搜索的关键词字符串 > 模型ID:(非必须)普通模型ID为1,如为0时则遍历所有模型搜索关键词 > 时间范围:(非必须)(可选值 day|week|month|year)为空则不限制时间 > 页码:(非必须)指定页(数字) ``` Route::rule('search/[:search]/modelid/:modelid/time/:time/[:page]/', 'cms/index/search'); Route::rule('search/[:search]/modelid/:modelid/[:page]/', 'cms/index/search'); Route::rule('search/[:search]/[:page]/', 'cms/index/search'); ``` > 4.网站地图[动态地图](访问url:http://domain/sitemap.html)对应模板路径:templates\主题目录\cms\sitemap.html ``` Route::rule('sitemap', 'cms/index/sitemap'); ``` > 5.CMS全站通用伪静态路由(参考下列规则修改cms url规则) > 注:当前默认栏目数据过滤器url定义为地区+项目层级 > ## ***修改以下路由定义必须由后端人员处理,否则易造成不可逆的数据损失*** ``` /******************************************cms URL自定义规则***********************************************/ //列表 筛选栏目标识列表支持分页 筛选支持 参数 /地区/项目/性质(需修改公共函数:add_filters() {}内的$allow_param $allow_param_text $filter_url_path 变量定义) //Route::rule('hospital/:area/:project/:xingzhi/[:page]/', 'cms/index/lists?catdir=hospital')->pattern(['page' => '[0-9]+', 'area' => '[a-z0-9]+', 'project' => '[a-z0-9]+', 'xingzhi' => '[0-9]+']); //联动数据筛选列表页路由:地区+项目(如:/hospital/sichuan/shuangyanpi/ /hospital/sichuan/shuangyanpi/1/ /hospital/sichuan/shuangyanpi/2/ /hospital/all/shuangyanpi/ /hospital/sichuan/all/) Route::rule('hospital/:area/:project/[:page]/', 'cms/index/lists?catdir=hospital')->pattern(['page' => '[0-9]+', 'area' => '[a-z]+', 'project' => '[a-z]+']); //联动数据筛选列表页路由:仅使用地区或项目过滤器(需修改公共函数:add_filters() {}内的$allow_param $allow_param_text $filter_url_path 变量定义) //Route::rule('hospital/:area/[:page]/', 'cms/index/lists?catdir=hospital')->pattern(['page' => '[0-9]+', 'area' => '[a-z]+']); //Route::rule('hospital/:project/[:page]/', 'cms/index/lists?catdir=hospital')->pattern(['page' => '[0-9]+', 'project' => '[a-z]+']); //列表 普通栏目标识列表支持页码(如:/hospital/ /hospital/1/ /hospital/2/) Route::rule(':catdir/[:page]/', 'cms/index/lists')->pattern(['catdir' => '[A-Za-z\/]+', 'page' => '[0-9]+']); //详情 (如:/hospital/123.html /doctor/124.html) Route::rule(':catdir/:id', 'cms/index/shows')->pattern(['catdir' => '[A-Za-z\/]+', 'id' => '\d+']); //分类详情(如:/hospital/address-123.html /hospital/case-123.html) Route::rule(':catdir/:typeclass-:id', 'cms/index/shows')->pattern(['catdir' => '[A-Za-z\/]+', 'typeclass' => '[A-Za-z]+', 'id' => '\d+']); /******************************************cms URL自定义规则***********************************************/ ```