app() app(null|string $id = null, array $params = []) : \ContainerInterface|object 获取容器或解析服务 Parameters null|string $id 服务ID array $params 可选构造参数 Returns \ContainerInterface|object —
cache_get() cache_get(string $key, mixed $default = null) : mixed Parameters string $key mixed $default Returns mixed —
cache_invalidate_tags() cache_invalidate_tags(array $tags) : bool Parameters array $tags Returns bool —
cache_set() cache_set(string $key, mixed $value, ?int $ttl = null, array $tags = []) : bool Parameters string $key mixed $value ?int $ttl array $tags Returns bool —
caches() caches(?string $key = null, mixed $value = '__GET__', ?int $ttl = null) : mixed Parameters ?string $key mixed $value ?int $ttl Returns mixed —
checkFilesChange() checkFilesChange(array $watchDirs, array $lastMtimes) : bool Parameters array $watchDirs array $lastMtimes Returns bool —
config() config(?string $key = null, mixed $default = null) : mixed 配置项读取(支持点语法) Parameters ?string $key mixed $default Returns mixed —
convert_to_symfony_request() convert_to_symfony_request(\Workerman\Protocols\Http\Request $request) : \Symfony\Component\HttpFoundation\Request Parameters \Workerman\Protocols\Http\Request $request Returns \Symfony\Component\HttpFoundation\Request —
convert_to_workerman_response() convert_to_workerman_response(\Symfony\Component\HttpFoundation\Response $res) : \Workerman\Protocols\Http\Response Parameters \Symfony\Component\HttpFoundation\Response $res Returns \Workerman\Protocols\Http\Response —
env() env(string $key, mixed $default = null) : mixed Parameters string $key mixed $default Returns mixed —
EventDispatch() EventDispatch(object $event) : object 事件分发函数. Parameters object $event Returns object —
getService() getService(string $id, array $params = []) : object 从容器中获取服务(别名或类名). Parameters string $id array $params Returns object —
getSymfonyStats() getSymfonyStats() : mixed Symfony组件加载统计脚本 使用 get_included_files() 和 get_declared_classes() 分析加载情况 Returns mixed —
redirectToRoute() redirectToRoute(string $routeName, array $parameters = [], int $status = 302) : \Symfony\Component\HttpFoundation\RedirectResponse 根据路由名称生成 URL 并返回重定向响应. Parameters string $routeName array $parameters int $status Throws \InvalidArgumentException Returns \Symfony\Component\HttpFoundation\RedirectResponse —
renders() renders(string $template, array $data = [], ?array $exclude = null) : string Parameters string $template array $data ?array $exclude Returns string —
ThinkValidate() ThinkValidate(array $data, array $rule, array $message = []) : array|true Parameters array $data array $rule array $message Returns array|true —
ThinkView() ThinkView(string $templateName, array $data = []) : string Think 模板渲染. Parameters string $templateName array $data Returns string —
tpTemplateFormatDate() tpTemplateFormatDate(int $timestamp, string $format = 'Y-m-d H:i:s') : string 自定义模板函数:格式化时间. Parameters int $timestamp string $format Returns string —
tpTemplateHello() tpTemplateHello(string $name) : string 自定义模板函数:返回欢迎信息. Parameters string $name Returns string —
trans() trans(string $key, array $parameters = []) : string 翻译服务. Parameters string $key array $parameters Returns string —
validate() validate(array $data, array|string $validate = '', array $message = [], bool $batch = false, bool $failException = true) : bool 生成验证对象 Parameters array $data 数据 array|string $validate 验证器类名或者验证规则数组 array $message 错误提示信息 bool $batch 是否批量验证 bool $failException 是否抛出异常 Returns bool —
view() view(string $template, array $data = []) : string Parameters string $template array $data Returns string —