mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-22 17:48:37 +08:00
Merge branch 'master' of github.com:yiisoft/yii2
This commit is contained in:
@@ -389,7 +389,6 @@ $width = \Yii::$app->params['thumbnail.size'][0];
|
||||
如果 [视图路径](#viewPath) 使用默认值,默认的布局路径别名为`@app/views/layouts`。
|
||||
|
||||
该属性需要配置成一个目录或 路径 [别名](concept-aliases.md)。
|
||||
You may configure it as a directory or a path [alias](concept-aliases.md).
|
||||
|
||||
|
||||
#### [[yii\base\Application::runtimePath|runtimePath]] <a name="runtimePath"></a>
|
||||
|
||||
@@ -283,7 +283,7 @@ class HelloWorldAction extends Action
|
||||
|
||||
### 操作结果 <a name="action-results"></a>
|
||||
|
||||
操作方法或独立操作的`run()`方法的返回值非常中药,它表示对应操作结果。
|
||||
操作方法或独立操作的`run()`方法的返回值非常重要,它表示对应操作结果。
|
||||
|
||||
返回值可为 [响应](runtime-responses.md) 对象,作为响应发送给终端用户。
|
||||
|
||||
@@ -378,8 +378,7 @@ class SiteController extends Controller
|
||||
|
||||
## 控制器生命周期 <a name="controller-lifecycle"></a>
|
||||
|
||||
处理一个请求时,[应用主体](structure-applications.md) 会根据请求[路由](#routes)创建一个控制器,will create a controller
|
||||
控制器经过以下生命周期来完成请求:
|
||||
处理一个请求时,[应用主体](structure-applications.md) 会根据请求[路由](#routes)创建一个控制器,控制器经过以下生命周期来完成请求:
|
||||
|
||||
1. 在控制器创建和配置后,[[yii\base\Controller::init()]] 方法会被调用。
|
||||
2. 控制器根据请求操作ID创建一个操作对象:
|
||||
|
||||
@@ -113,7 +113,7 @@ echo Yii::$app->formatter->asDate('now', 'php:Y-m-d'); // 2014-10-06
|
||||
### Time zones <a name="time-zones"></a>
|
||||
|
||||
When formatting date and time values, Yii will convert them to the [[yii\i18n\Formatter::timeZone|configured time zone]].
|
||||
Therefor the input value is assumed to be in UTC unless a time zone is explicitly given. For this reason
|
||||
Therefore the input value is assumed to be in UTC unless a time zone is explicitly given. For this reason
|
||||
it is recommended to store all date and time values in UTC preferably as a UNIX timestamp, which is always UTC by definition.
|
||||
If the input value is in a time zone different from UTC, the time zone has to be stated explicitly like in the following example:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ be used. Therefore, each request should come with some sort of authentication cr
|
||||
the user authentication status may not be maintained by sessions or cookies. A common practice is
|
||||
to send a secret access token with each request to authenticate the user. Since an access token
|
||||
can be used to uniquely identify and authenticate a user, **API requests should always be sent
|
||||
via HTTPS to prevent from man-in-the-middle (MitM) attacks**.
|
||||
via HTTPS to prevent man-in-the-middle (MitM) attacks**.
|
||||
|
||||
There are different ways to send an access token:
|
||||
|
||||
|
||||
@@ -408,7 +408,7 @@ abstract class BaseMigrateController extends Controller
|
||||
* ~~~
|
||||
*
|
||||
* @param integer $limit the maximum number of new migrations to be displayed.
|
||||
* If it is 0, all available new migrations will be displayed.
|
||||
* If it is `all`, all available new migrations will be displayed.
|
||||
* @throws \yii\console\Exception if invalid limit value passed
|
||||
*/
|
||||
public function actionNew($limit = 10)
|
||||
@@ -642,4 +642,4 @@ abstract class BaseMigrateController extends Controller
|
||||
* @param string $version migration version name.
|
||||
*/
|
||||
abstract protected function removeMigrationHistory($version);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user