/book/diyizhangjie.html 章节伪静态怎么写 迅睿框架 更新 2021-12-04 20:39:03 qqd /book/diyizhangjie.html 章节路径是这样的diyizhangjie 这段每个章节的标题拼音请问rewrite.php里面伪静态怎么写 来对应/book/diyizhangjie.html 这个路径章节动态路径 是这个 /index.php?s=book&c=son&m=show&id=10244非常感谢
3、打开 config/rewrite.php 把原来的内容规则/***********************独立模块测试规则:内容页面的伪静态解析*************************/"([a-z]+)\/show\/([0-9]+).html(.*)" => 'index.php?s=$1&c=show&id=$2',改成"([a-z]+)\/([a-z0-9]+).html(.*)" => 'index.php?s=$1&c=show&id=$2',4、打开 dayrui/App/Book/Controllers/Show.php 找到第6行的index方法public function index() { $this->_module_init(); $this->_Show( (int)\Phpcmf\Service::L('Input')->get('id'), [ 'field' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('field')), 'value' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('value')), ], max(1, (int)\Phpcmf\Service::L('Input')->get('page')) );}改成public function index() { $this->_module_init(); $id = \Phpcmf\Service::L('Input')->get('id'); if ($cid = \Phpcmf\Service::L("cache")->get_file("dr_book_".$id , "dr_book")) { $id = $cid; } $this->_Show( (int)$id, [ 'field' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('field')), 'value' => dr_safe_replace(\Phpcmf\Service::L('Input')->get('value')), ], max(1, (int)\Phpcmf\Service::L('Input')->get('page')) );}5、更新URL