Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to rewrite the U of ThinkPHP to make its routing paging work properly

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "how to rewrite the U of ThinkPHP to make its routing paging normal". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

If (! empty ($vars)) {/ / add parameter foreach ($vars as $var = > $val) {if (''! = = trim ($val)) $url. = $depr. $var. $depr. Urlencode ($val);}

Add the following code after it

/ * * after tp starts routing, the next page of routing failure question URL assembly * / / if routing if (C ('URL_ROUTER_ON')) {foreach (C (' URL_ROUTE_RULES') as $zhaolg = > $zlig) {/ / traversal routing if (strstr ('/ '.GROUP _ NAME.$url,$zlig)) {/ / find routing rule $lg = strstr ($zhaolg,'/:') from the URL / / Analysis rules with parameters? If ($lg) {/ / if the rule takes the parameter $tempzlg = str_replace ('/:','', $lg); / / take the parameter / / dump ($tempzlg); if ($tempzlg) {if (C ('APP_SUB_DOMAIN_DEPLOY')) {$zlgurl = str_replace ($zlig,$zhaolg,'/'.GROUP_NAME.$url) / / url is replaced by routing rule} else {$zlgurl = str_replace ($zlig,$zhaolg,$url); / / url is replaced by routing rule} / / Note / s _ url is replaced by a routing rule} / / Note / s _ zlgurl _ / / dump ($zlgurl); $url = str_replace ($lg.'/'.$tempzlg,'',$zlgurl) / / url replace routing rule parameter} else {/ / Analysis rule without parameter if (C ('APP_SUB_DOMAIN_DEPLOY')) {$url = str_replace ($zlig,$zhaolg,'/'.GROUP_NAME.$url); / / url replace routing rule} else {$url = str_replace ($zlig,$zhaolg,$url) / / url is replaced by routing rule}, "how to rewrite the U of ThinkPHP to make its routing paging work properly" ends here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report