コード例 #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());
 }