src/Foundation/Api.php
protected function filterCheck()
    {
        $filter = DI()->get('filter', 'PhalApi_Filter_None');

        if (isset($filter)) {
            if (!($filter instanceof PhalApi_Filter)) {
                throw new BadRequest(
                    T('DI()->filter should be instanceof PhalApi_Filter'));
            }

            $filter->check();
        }
    }
protected function filterCheck()
    {
        $filter = DI()->get('filter', 'PhalApi_Filter_None');

        if (isset($filter)) {
            if (!($filter instanceof PhalApi_Filter)) {
                throw new BadRequest(
                    T('DI()->filter should be instanceof PhalApi_Filter'));
            }

            $filter->check();
        }
    }
过滤器调用

可由开发人员根据需要重载，以实现项目拦截处理，需要：
- 1、实现PhalApi_Filter::check()接口
- 2、注册的过滤器到DI()->filter

<br>以下是一个简单的示例：<br>
```
class My_Filter implements PhalApi_Filter {

public function check() {
//TODO
}
}


//在初始化文件 init.php 中注册过滤器
DI()->filter = 'My_Filter';
```

@see PhalApi_Filter::check()

@throws BadRequest 当验证失败时，请抛出此异常，以返回400