services.php 769 B

123456789101112131415161718192021222324252627
  1. <?php
  2. use Cygnite\Foundation\Application as App;
  3. if (!defined('CF_SYSTEM')) {
  4. exit('External script access not allowed');
  5. }
  6. // Register all service provider
  7. App::service(function ($app)
  8. {
  9. // Add multiple Service Provider into the array
  10. /*
  11. $app->registerServiceProvider(
  12. array(
  13. "Apps\\Services\\Payment\\ApiServiceProvider",
  14. )
  15. );
  16. // Use Controller as Service manual configuration
  17. $app['user.controller'] = function () use($app)
  18. {
  19. return new \Apps\Controllers\HelloController(new \Cygnite\Mvc\Controller\ServiceController, $app);
  20. };
  21. // OR
  22. // Controller as Service automatic configuration
  23. $app->setServiceController('hello.controller', '\Application\Controllers\HelloController');*/
  24. });