This commit is contained in:
2020-08-31 14:02:54 +08:00
parent 814e73866e
commit 073dee78b9
2 changed files with 16 additions and 1 deletions
+16
View File
@@ -47,6 +47,22 @@ class Application extends BaseApplication
}
/**
* @param $name
* @param $service
* @return Application
* @throws Exception
*/
public function import(string $name, string $service)
{
$class = $this->set($name, ['class' => $service]);
if (method_exists($class, 'onImport')) {
$class->onImport($this);
}
return $this;
}
/**
* @throws Exception
*/