mirror of https://gitee.com/karson/fastadmin.git
优化为 ConfigModel
parent
8af7f5653a
commit
9c13b07f73
|
|
@ -28,7 +28,8 @@ class Config extends Backend
|
||||||
public function _initialize()
|
public function _initialize()
|
||||||
{
|
{
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = model('Config');
|
// $this->model = model('Config');
|
||||||
|
$this->model = new ConfigModel;
|
||||||
ConfigModel::event('before_write', function ($row) {
|
ConfigModel::event('before_write', function ($row) {
|
||||||
if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) {
|
if (isset($row['name']) && $row['name'] == 'name' && preg_match("/fast" . "admin/i", $row['value'])) {
|
||||||
throw new Exception(__("Site name incorrect"));
|
throw new Exception(__("Site name incorrect"));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue