/** * request response view * * @param string $property * @return Response|Request|View|Config|null */ function __get($property) { switch ($property) { case 'config': return $this->config = $this->delegate->getConfig(); case 'request': return $this->request = Request::getInstance(); case 'response': return $this->response = Response::getInstance(); case 'view': return $this->view = $this->initView(); } return null; }
/** * 实例化Application * * @param string $app_name * @param Delegate $delegate */ function __construct($app_name, Delegate $delegate) { $this->app_name = $app_name; $this->delegate = $delegate; $this->config = $delegate->getConfig(); }