改名
This commit is contained in:
+10
-6
@@ -26,10 +26,10 @@ class GiiController extends GiiBase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string|bool
|
||||||
* @throws Exception
|
* @throws \ReflectionException
|
||||||
*/
|
*/
|
||||||
public function generate(): string
|
public function generate(): string|bool
|
||||||
{
|
{
|
||||||
$path = $this->getControllerPath();
|
$path = $this->getControllerPath();
|
||||||
$modelPath = $this->getModelPath();
|
$modelPath = $this->getModelPath();
|
||||||
@@ -50,10 +50,14 @@ namespace {$namespace};
|
|||||||
|
|
||||||
';
|
';
|
||||||
if (file_exists($path['path'] . '/' . $managerName . 'Controller.php')) {
|
if (file_exists($path['path'] . '/' . $managerName . 'Controller.php')) {
|
||||||
$class = Snowflake::getDi()->getReflect($controller);
|
try {
|
||||||
|
$class = new \ReflectionClass($controller);
|
||||||
|
|
||||||
$import = $this->getImports($path['path'] . '/' . $managerName . 'Controller.php', $class);
|
$import = $this->getImports($path['path'] . '/' . $managerName . 'Controller.php', $class);
|
||||||
}else{
|
} catch (\Throwable $exception) {
|
||||||
|
return logger()->addError($exception);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
$import = "use Snowflake;
|
$import = "use Snowflake;
|
||||||
use exception;
|
use exception;
|
||||||
use Annotation\Target;
|
use Annotation\Target;
|
||||||
|
|||||||
Reference in New Issue
Block a user