예제 #1
0
 /**
  *
  */
 public function testGetServiceWithService()
 {
     $services = new Container();
     $application = new Application(new \ArrayObject(), new Request(), $services);
     $application->addService('service1', function () {
         return 'value1';
     });
     $this->assertSame('value1', $application->getService('service1'));
 }
예제 #2
0
 /**
  * init the module.
  *
  * @param Application $application
  */
 public function init(Application $application)
 {
     $application->addService('staticController', new StaticControllerService());
     $application->any(':all', $application->getService('staticController'));
 }
예제 #3
0
 /**
  * init the module.
  *
  * @param Application $application
  */
 public function init(Application $application)
 {
     $application->addService('template', new TemplateService([new TemplateExtension($application->getServices())]));
 }
예제 #4
0
 /**
  * init the module.
  *
  * @param Application $application
  */
 public function init(Application $application)
 {
     $application->addService('session', new SessionService());
 }