改进操作获取

This commit is contained in:
thinkphp
2018-03-26 17:24:20 +08:00
parent e6b7e87586
commit 97de5ec026
4 changed files with 12 additions and 10 deletions

View File

@@ -1466,11 +1466,12 @@ class Request
*/
public function action($action = null)
{
if (!is_null($action)) {
if (!is_null($action) && !is_bool($action)) {
$this->action = $action;
return $this;
} else {
return $this->action ?: '';
$name = $this->action ?: '';
return true === $action ? $name : strtolower($name);
}
}