1 Star 1 Fork 0

是我狼/RapidRouter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Route.php 899 Bytes
一键复制 编辑 原始数据 按行查看 历史
是我狼 提交于 2015-12-07 16:09 . callback for class
<?php
/**
* Created by zhouzhongyuan.
* User: zhouzhongyuan
* Date: 2015/11/28
* Time: 17:49
*/
namespace shiwolang\router;
class Route extends CallBack
{
public $pattern = null;
public $matchs = [];
public $routeString = "";
public function match($routeString)
{
$this->routeString = $routeString;
return preg_match($this->pattern, $routeString, $this->matchs);
}
protected function callClassMethod($className, $method, $params)
{
$classNameFull = $className . "::" . $method;
$classNameFull = preg_replace($this->pattern, $classNameFull, $this->routeString);
$class = explode("::", $classNameFull);
return parent::callClassMethod($class[0], $class[1], $params);
}
/**
* @return string
*/
public function getPattern()
{
return $this->pattern;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/shiwolang/RapidRouter.git
[email protected]:shiwolang/RapidRouter.git
shiwolang
RapidRouter
RapidRouter
master

搜索帮助