mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
解决非windows环境下getModelName获取不到basename的bug
basename:在 Windows 中,斜线(/)和反斜线(\)都可以用作目录分隔符。在其它环境下是斜线(/)。
This commit is contained in:
@@ -1198,7 +1198,8 @@ class Model
|
|||||||
public function getModelName()
|
public function getModelName()
|
||||||
{
|
{
|
||||||
if (empty($this->name)) {
|
if (empty($this->name)) {
|
||||||
$this->name = basename(get_class($this));
|
// 解决非windows环境下获取不到basename的bug(xiaobo.sun modify 20160215)
|
||||||
|
$this->name = basename(str_replace('\\', '/', get_class($this)));
|
||||||
}
|
}
|
||||||
return $this->name;
|
return $this->name;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user