catchAdmin/extend/catcher/base/CatchController.php

54 lines
1006 B
PHP
Raw Normal View History

2019-12-06 09:17:40 +08:00
<?php
namespace catcher\base;
use catcher\CatchAdmin;
2019-12-12 09:14:08 +08:00
abstract class CatchController
2019-12-06 09:17:40 +08:00
{
2020-01-09 08:22:38 +08:00
/**public function __construct()
2019-12-17 09:03:04 +08:00
{
$this->loadConfig();
2020-01-09 08:22:38 +08:00
}*/
2019-12-06 09:17:40 +08:00
2019-12-13 17:26:54 +08:00
2019-12-17 09:03:04 +08:00
/**
*
*
* @time 2019年12月15日
* @return void
*/
2020-01-09 08:22:38 +08:00
protected function loadConfig(): void
2019-12-17 09:03:04 +08:00
{
$module = explode('\\', get_class($this))[1];
$moduleConfig = CatchAdmin::moduleDirectory($module) . 'config.php';
if (file_exists(CatchAdmin::moduleDirectory($module) . 'config.php')) {
app()->config->load($moduleConfig);
}
}
2019-12-13 17:26:54 +08:00
/**
*
* @time 2019年12月13日
* @param $name
* @param $value
* @return void
*/
public function __set($name, $value)
{
// TODO: Implement __set() method.
2019-12-26 09:03:19 +08:00
$this->{$name} = $value;
2019-12-13 17:26:54 +08:00
}
public function __get($name)
{
// TODO: Implement __get() method.
}
public function __isset($name)
{
// TODO: Implement __isset() method.
}
2019-12-06 09:17:40 +08:00
}