Route类的bind方法参数顺序调整 增加getBind方法用于获取绑定信息

This commit is contained in:
thinkphp
2016-06-24 12:33:07 +08:00
parent 1a8bbf6725
commit 87ad5e95bb
5 changed files with 67 additions and 61 deletions

View File

@@ -123,19 +123,26 @@ class Route
}
/**
* 设置和读取路由绑定
* 设置路由绑定
* @access public
* @param string $type 请求类型
* @param mixed $bind 绑定信息
* @param string $type 绑定类型 默认为module
* @return mixed
*/
public static function bind($type, $bind = '')
public static function bind($bind, $type = 'module')
{
if ('' == $bind) {
return isset(self::$bind[$type]) ? self::$bind[$type] : null;
} else {
self::$bind = ['type' => $type, $type => $bind];
}
self::$bind = ['type' => $type, $type => $bind];
}
/**
* 读取路由绑定
* @access public
* @param string $type 绑定类型
* @return mixed
*/
public static function getBind($type)
{
return isset(self::$bind[$type]) ? self::$bind[$type] : null;
}
/**