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