mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-07-17 04:31:05 +08:00
优先执行带有函数名开头的回调方法再执行通用回调方法
This commit is contained in:
parent
e757ba1ec9
commit
bbf4d5832f
@ -177,7 +177,7 @@ abstract class Controller extends \stdClass
|
|||||||
public function callback($name, &$one = [], &$two = [])
|
public function callback($name, &$one = [], &$two = [])
|
||||||
{
|
{
|
||||||
if (is_callable($name)) return call_user_func($name, $this, $one, $two);
|
if (is_callable($name)) return call_user_func($name, $this, $one, $two);
|
||||||
foreach ([$name, "_{$this->app->request->action()}{$name}"] as $method) {
|
foreach (["_{$this->app->request->action()}{$name}", $name] as $method) {
|
||||||
if (method_exists($this, $method) && false === $this->$method($one, $two)) {
|
if (method_exists($this, $method) && false === $this->$method($one, $two)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user