为了账号安全,请及时绑定邮箱和手机立即绑定

typecho的路由规则是啥?

typecho的路由规则是啥?

慕姐4208626 2019-03-30 11:36:15
Typecho/Router/Parser.php中的parse方法里面的正则表达式是啥意思?附代码:publicfunctionparse(){$result=array();foreach($this->_routingTableas$key=>$route){$this->_params=array();//在_routingTables,[regx]=>|^/attachment/([0-9]+)[/]?$|$route['regx']=preg_replace_callback("/%([^%]+)%/",array($this,'_match'),//[url]=>/attachment/[cid:digital]/preg_quote(str_replace(array('[',']',':'),array('%','%',''),$route['url'])));/**处理斜线*/$route['regx']=rtrim($route['regx'],'/');$route['regx']='|^'.$route['regx'].'[/]?$|';$route['format']=preg_replace("/\[([^\]]+)\]/","%s",$route['url']);$route['params']=$this->_params;$result[$key]=$route;}return$result;}
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 328 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信