1 | <?php |
||
27 | class Application extends \yii\base\Application |
||
28 | { |
||
29 | /** |
||
30 | * @var string the default route of this application. Defaults to 'site'. |
||
31 | */ |
||
32 | public $defaultRoute = 'site'; |
||
33 | /** |
||
34 | * @var array the configuration specifying a controller action which should handle |
||
35 | * all user requests. This is mainly used when the application is in maintenance mode |
||
36 | * and needs to handle all incoming requests via a single action. |
||
37 | * The configuration is an array whose first element specifies the route of the action. |
||
38 | * The rest of the array elements (key-value pairs) specify the parameters to be bound |
||
39 | * to the action. For example, |
||
40 | * |
||
41 | * ```php |
||
42 | * [ |
||
43 | * 'offline/notice', |
||
44 | * 'param1' => 'value1', |
||
45 | * 'param2' => 'value2', |
||
46 | * ] |
||
47 | * ``` |
||
48 | * |
||
49 | * Defaults to null, meaning catch-all is not used. |
||
50 | */ |
||
51 | public $catchAll; |
||
52 | /** |
||
53 | * @var Controller the currently active controller instance |
||
54 | */ |
||
55 | public $controller; |
||
56 | |||
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | 113 | protected function bootstrap() |
|
69 | |||
70 | /** |
||
71 | * Handles the specified request. |
||
72 | * @param Request $request the request to be handled |
||
73 | * @return Response the resulting response |
||
74 | * @throws NotFoundHttpException if the requested route is invalid |
||
75 | */ |
||
76 | public function handleRequest($request) |
||
115 | |||
116 | private $_homeUrl; |
||
117 | |||
118 | /** |
||
119 | * @return string the homepage URL |
||
120 | */ |
||
121 | 3 | public function getHomeUrl() |
|
133 | |||
134 | /** |
||
135 | * @param string $value the homepage URL |
||
136 | */ |
||
137 | public function setHomeUrl($value) |
||
141 | |||
142 | /** |
||
143 | * Returns the error handler component. |
||
144 | * @return ErrorHandler the error handler application component. |
||
145 | */ |
||
146 | public function getErrorHandler() |
||
150 | |||
151 | /** |
||
152 | * Returns the request component. |
||
153 | * @return Request the request component. |
||
154 | */ |
||
155 | 113 | public function getRequest() |
|
159 | |||
160 | /** |
||
161 | * Returns the response component. |
||
162 | * @return Response the response component. |
||
163 | */ |
||
164 | 56 | public function getResponse() |
|
168 | |||
169 | /** |
||
170 | * Returns the session component. |
||
171 | * @return Session the session component. |
||
172 | */ |
||
173 | 26 | public function getSession() |
|
177 | |||
178 | /** |
||
179 | * Returns the user component. |
||
180 | * @return User the user component. |
||
181 | */ |
||
182 | 23 | public function getUser() |
|
186 | |||
187 | /** |
||
188 | * @inheritdoc |
||
189 | */ |
||
190 | 113 | public function coreComponents() |
|
200 | } |
||
201 |