ThinkPHP3.1.3 in the case of enabling routing, its paging address is not the address of the route, because the thinkphp3.2.1 code is not fixed, many people have encountered this problem, this article adopts olcms modification method to solve this problem, especially thanks to Phper Jack's contribution to this, the specific solution is to modify the thinkphp functions.php U method, in 287 rows or so:
if (!empty ($vars)) { //Add parameter foreach ($vars as $var = = $val) {if ('!== trim ($val)) $url. = $depr. $var. $depr. u Rlencode ($val); }
Add the following code later
/** TP Open route Next page Routing failure Problem page class URL assembly *//If the route is turned on (C (' url_router_on ')) {foreach (C (' Url_route_rules ') as $zhaolg + = $zlig) {//Traverse route if (strstr ('/'). Group_name. $url, $zlig)) {//Find routing rules from urls $lg = strstr ($zhaolg, '/: ');//analysis rule with parameters? if ($LG) {//If the rule has parameters $tempzlg = Str_replace ('/: ', ' ', $LG);//Take parameter//dump ($TEMPZLG); if ($TEMPZLG) {if (C (' App_sub_domain_deploy ')) {$zlgurl = Str_replace ($zlig, $zhaolg, '/'). Group_name. $url); The URL is replaced by the routing rule}else{$zlgurl = Str_replace ($zlig, $zhaolg, $url);//url is replaced by the routing rule} Note/s/:c/c/4/p/__page__//dump ($zlgurl); $url = Str_replace ($lg. '/'. $tempzlg, ', $zlgurl);//url replace route rule parameters}}else{//analysis rule without parameters if (C (' App_sub_domain_deploy ')) {$url = Str_replace ($zlig, $zhaolg, '/'). Group_name. $url);//url Replace with routing rule}else{$url = Str_replace ($zlig, $zhaolg, $url);//url Replace with routing rules} } } } }
This solves the problem!
http://www.bkjia.com/PHPjc/824664.html www.bkjia.com true http://www.bkjia.com/PHPjc/824664.html techarticle ThinkPHP3.1.3 in the case of enabling routing, its paging address is not the address of the route, because thinkphp3.2.1 code is not fixed, many people have encountered this problem, this article adopted OLCM ...