diff --git a/HttpServer/Controller.php b/HttpServer/Controller.php index f3b8647c..5ff1c278 100644 --- a/HttpServer/Controller.php +++ b/HttpServer/Controller.php @@ -99,6 +99,12 @@ class Controller extends Application if (method_exists($this, $method)) { return $this->$method(); } + + $app = Snowflake::app(); + if ($app->has($name)) { + return $app->get($name); + } + return parent::__get($name); } diff --git a/System/Abstracts/BaseApplication.php b/System/Abstracts/BaseApplication.php index 471543f8..0902d989 100644 --- a/System/Abstracts/BaseApplication.php +++ b/System/Abstracts/BaseApplication.php @@ -45,6 +45,7 @@ use Database\DatabasesProviders; * @property Memcached $memcached * @property Logger $logger * @property Jwt $jwt + * @property BaseGoto $goto */ abstract class BaseApplication extends Service { @@ -371,7 +372,8 @@ abstract class BaseApplication extends Service 'logger' => ['class' => Logger::class], 'router' => ['class' => Router::class], 'redis' => ['class' => Redis::class], - 'jwt' => ['class' => Jwt::class] + 'jwt' => ['class' => Jwt::class], + 'goto' => ['class' => BaseGoto::class] ]); } } diff --git a/System/Abstracts/BaseGoto.php b/System/Abstracts/BaseGoto.php new file mode 100644 index 00000000..bb616111 --- /dev/null +++ b/System/Abstracts/BaseGoto.php @@ -0,0 +1,27 @@ +