PHP Class Cml\Route

Show file Open project: linhecheng/cmlphp Class Usage Examples

Public Methods

Method Description
__callStatic ( string $name, array $arguments ) : mixed 访问Cml::getContainer()->make('cml_route')中其余方法
any ( string $pattern, string | array $action ) : void 增加任意访问方式路由
delete ( string $pattern, string | array $action ) : void 增加delete访问方式路由
get ( string $pattern, string | array $action ) : void 增加get访问方式路由
getPathInfo ( ) : array 获取解析后的pathInfo信息
group ( string $namespace, callable $func ) 分组路由
loadAppRoute ( string $app = 'web' ) 载入应用单独的路由
options ( string $pattern, string | array $action ) : void 增加options访问方式路由
parsePathInfo ( ) : void 解析url获取pathinfo
patch ( string $pattern, string | array $action ) : void 增加patch访问方式路由
post ( string $pattern, string | array $action ) : void 增加post访问方式路由
put ( string $pattern, string | array $action ) : void 增加put访问方式路由
rest ( string $pattern, string | array $action ) : void 增加REST方式路由
setPathInfo ( array $pathInfo ) : array 设置pathInfo信息

Method Details

__callStatic() public static method

访问Cml::getContainer()->make('cml_route')中其余方法
public static __callStatic ( string $name, array $arguments ) : mixed
$name string
$arguments array
return mixed

any() public static method

增加任意访问方式路由
public static any ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

delete() public static method

增加delete访问方式路由
public static delete ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

get() public static method

增加get访问方式路由
public static get ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

getPathInfo() public static method

获取解析后的pathInfo信息
public static getPathInfo ( ) : array
return array

group() public static method

分组路由
public static group ( string $namespace, callable $func )
$namespace string 分组名
$func callable 闭包

loadAppRoute() public static method

载入应用单独的路由
public static loadAppRoute ( string $app = 'web' )
$app string 应用名称

options() public static method

增加options访问方式路由
public static options ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

parsePathInfo() public static method

解析url获取pathinfo
public static parsePathInfo ( ) : void
return void

patch() public static method

增加patch访问方式路由
public static patch ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

post() public static method

增加post访问方式路由
public static post ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

put() public static method

增加put访问方式路由
public static put ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

rest() public static method

增加REST方式路由
public static rest ( string $pattern, string | array $action ) : void
$pattern string 路由规则
$action string | array 执行的操作
return void

setPathInfo() public static method

设置pathInfo信息
public static setPathInfo ( array $pathInfo ) : array
$pathInfo array
return array