container = $this->getContainer(); $this->container->registerMiddleware(new HttpMiddleware($this->container)); $this->app = new App($this->container->query('API')->getUserId()); $this->registerServices(); } public function registerServices() { $app = $this->app; $this->container->registerService('PageController', function(IAppContainer $container) use($app) { return new PageController($container, $app); }); $this->container->registerService('AddressBookController', function(IAppContainer $container) use($app) { return new AddressBookController($container, $app); }); $this->container->registerService('GroupController', function(IAppContainer $container) use($app) { return new GroupController($container, $app); }); $this->container->registerService('ContactController', function(IAppContainer $container) use($app) { return new ContactController($container, $app); }); $this->container->registerService('ContactPhotoController', function(IAppContainer $container) use($app) { return new ContactPhotoController($container, $app); }); $this->container->registerService('SettingsController', function(IAppContainer $container) use($app) { return new SettingsController($container, $app); }); $this->container->registerService('ImportController', function(IAppContainer $container) use($app) { return new ImportController($container, $app); }); $this->container->registerService('ExportController', function(IAppContainer $container) use($app) { return new ExportController($container, $app); }); } }