PHP Class Cml\Route

Afficher le fichier Open project: linhecheng/cmlphp Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

any() public static méthode

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

delete() public static méthode

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

get() public static méthode

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

getPathInfo() public static méthode

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

group() public static méthode

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

loadAppRoute() public static méthode

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

options() public static méthode

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

parsePathInfo() public static méthode

解析url获取pathinfo
public static parsePathInfo ( ) : void
Résultat void

patch() public static méthode

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

post() public static méthode

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

put() public static méthode

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

rest() public static méthode

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

setPathInfo() public static méthode

设置pathInfo信息
public static setPathInfo ( array $pathInfo ) : array
$pathInfo array
Résultat array