homepagePHP/docs/Controller.md

19 lines
640 B
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Controller
#### redirect
```blade
Action跳转(URL重定向 支持指定模块和延时跳转若访问为ajax方式则返回json数据类型
string $url 跳转的URL表达式
array $params 其它URL参数默认为空
integer $delay 延时跳转的时间单位为秒非ajax方式有效默认为0
string $msg 跳转提示信息,默认为空
integer $status 状态信息ajax方式有效默认为0
boolean $ajax 是否为ajax方式默认为false
```
```php
// 在Controller控制器中使用
// 若访问为ajax方式则返回json数据类型
$this->redirect('/admin/public/login', '', 0, '请先登录');
```