\hymie\filterFilter

过滤器在 Controller 执行前做一系列检查工作。

如果通过检查则返回 true,后续过滤器继续执行,如果所有过滤器都返回 true,则 Controller 可以执行。

如果某条过滤器检查不通过,Filter 可以进行以下处理:

  1. 返回 \hymie\Result 结果对象 如果是 ajax 请求,则 \hymie\Application 会直接向浏览器输出 json 如果不是 ajax 请求,则会返回到相匹配的视图

  2. 在 Filter 中使用 R($toPath) 进行页面跳转

  3. 返回代表视图名的 string

Summary

Methods
Properties
Constants
doFilter()
accept()
setTargetPath()
setExcludePath()
getTargetPath()
getExcludePath()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
matchPath()
checkInExclude()
$targetPath
$excludePath
N/A

Properties

$targetPath

$targetPath : 

Type

$excludePath

$excludePath : 

Type

Methods

doFilter()

doFilter() : boolean|\hymie\Result

过滤器方法,过滤器在 Controller 执行前做一系列检查工作。

如果通过检查则返回 true,后续拦截器继续执行,如果全部通过 怎控制器可以执行。

返回:

  1. 返回 \hymie\Result 结果对象 如果是 ajax 请求,则 \hymie\Application 会直接向浏览器输出 json 如果不是 ajax 请求,则会返回到相匹配的视图

  2. 在 Filter 中使用 R($toPath) 进行页面跳转

  3. 返回代表视图名的 string

Returns

boolean|\hymie\Result

accept()

accept(  $path) 

Parameters

$path

setTargetPath()

setTargetPath(  $value) 

Parameters

$value

setExcludePath()

setExcludePath(  $value) 

Parameters

$value

getTargetPath()

getTargetPath() 

getExcludePath()

getExcludePath() 

matchPath()

matchPath(string  $regex, string  $path) : boolean

检测当前请求路径是否满足过滤器配置的正则表达式

Parameters

string $regex
string $path

Returns

boolean

checkInExclude()

checkInExclude(  $path) 

检查路径是否是不需要拦截的路径

Parameters

$path