Home > php教程 > php手册 > TPURL路由支持中文参数

TPURL路由支持中文参数

WBOY
Release: 2016-06-07 11:42:27
Original
1552 people have browsed it

修改TP的URL路由转换代码,让URL路由支持中文参数。
路由规则'/^Search\/([a-z]+)_([%A-Za-z0-9]+)_(\d+)_(\d+)_(\d+)$/' => 'Goods/search?s=:1&k=:2&o=:3&r=:4&p=:5',ThinkPHP\Lib\Behavior\CheckRouteBehavior.class.php line38$depr = URLEncode(C('URL_PATHINFO_DEPR'));<br> // 分隔符替换 确保路由定义使用统一的分隔符<br> $regx = str_replace($depr,'/',URLEncode($regx));

AD:真正免费,域名+虚机+企业邮箱=0元

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template