initialize() public method

This method exists because the kernel/service container needs to be set before the page's functionality gets loaded. Any functionality of the app should be initialized afterwards.
public initialize ( )
示例#1
0
 /**
  * Runs an application and returns the Response
  *
  * @param \ApplicationInterface $application
  *
  * @return Symfony\Component\HttpFoundation\Response
  */
 protected function handleApplication(\ApplicationInterface $application)
 {
     $application->passContainerToModels();
     try {
         $application->initialize();
         return $application->display();
     } catch (RedirectException $ex) {
         return $ex->getResponse();
     }
 }