mirror of https://gitee.com/karson/fastadmin.git
parent
71617c2526
commit
35b0d64cc2
|
|
@ -197,6 +197,13 @@ class Menu extends Command
|
||||||
if (in_array('trashed', get_class_methods($model))) {
|
if (in_array('trashed', get_class_methods($model))) {
|
||||||
$withSofeDelete = true;
|
$withSofeDelete = true;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
preg_match_all("/\\\$this\->model\s*=\s*new\s+([a-zA-Z\\\]+);/", $classContent, $matches);
|
||||||
|
\think\Request::instance()->module('admin');
|
||||||
|
$model = new $matches[1][0];
|
||||||
|
if (in_array('trashed', get_class_methods($model))) {
|
||||||
|
$withSofeDelete = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//忽略的类
|
//忽略的类
|
||||||
if (stripos($classComment, "@internal") !== FALSE) {
|
if (stripos($classComment, "@internal") !== FALSE) {
|
||||||
|
|
@ -226,7 +233,13 @@ class Menu extends Command
|
||||||
$pid = 0;
|
$pid = 0;
|
||||||
foreach ($controllerArr as $k => $v) {
|
foreach ($controllerArr as $k => $v) {
|
||||||
$key = $k + 1;
|
$key = $k + 1;
|
||||||
$name = strtolower(implode('/', array_slice($controllerArr, 0, $key)));
|
//驼峰转下划线
|
||||||
|
$controllerNameArr = array_slice($controllerArr, 0, $key);
|
||||||
|
foreach ($controllerNameArr as &$val) {
|
||||||
|
$val = strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $val), "_"));
|
||||||
|
}
|
||||||
|
unset($val);
|
||||||
|
$name = implode('/', $controllerNameArr);
|
||||||
$title = (!isset($controllerArr[$key]) ? $controllerTitle : '');
|
$title = (!isset($controllerArr[$key]) ? $controllerTitle : '');
|
||||||
$icon = (!isset($controllerArr[$key]) ? $controllerIcon : 'fa fa-list');
|
$icon = (!isset($controllerArr[$key]) ? $controllerIcon : 'fa fa-list');
|
||||||
$remark = (!isset($controllerArr[$key]) ? $controllerRemark : '');
|
$remark = (!isset($controllerArr[$key]) ? $controllerRemark : '');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue