mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Various documentation fixes [skip ci]
This commit is contained in:

committed by
Alexander Makarov

parent
f0e999e017
commit
acbdccb45d
@ -130,7 +130,7 @@ public function extraFields()
|
|||||||
|
|
||||||
Согласно [HATEOAS](http://en.wikipedia.org/wiki/HATEOAS), расшифровывающемуся как Hypermedia as the Engine of Application State,
|
Согласно [HATEOAS](http://en.wikipedia.org/wiki/HATEOAS), расшифровывающемуся как Hypermedia as the Engine of Application State,
|
||||||
RESTful API должны возвращать достаточно информации для того, чтобы клиенты могли определить возможные действия над ресурсами.
|
RESTful API должны возвращать достаточно информации для того, чтобы клиенты могли определить возможные действия над ресурсами.
|
||||||
Ключевой момент HATEOAS заключается том, чтобы возвращать вместе с данными набора гиперссылок, указывающих на связанную
|
Ключевой момент HATEOAS заключается в том, чтобы возвращать вместе с данными набора гиперссылок, указывающих на связанную
|
||||||
с ресурсом информацию.
|
с ресурсом информацию.
|
||||||
|
|
||||||
Поддержку HATEOAS в ваши классы ресурсов можно добавить реализовав интерфейс [[yii\web\Linkable]]. Этот интерфейс
|
Поддержку HATEOAS в ваши классы ресурсов можно добавить реализовав интерфейс [[yii\web\Linkable]]. Этот интерфейс
|
||||||
|
@ -700,7 +700,7 @@ echo GridView::widget([
|
|||||||
### Using GridView with Pjax
|
### Using GridView with Pjax
|
||||||
|
|
||||||
The [[yii\widgets\Pjax|Pjax]] widget allows you to update a certain section of a
|
The [[yii\widgets\Pjax|Pjax]] widget allows you to update a certain section of a
|
||||||
page instead of reloading the entire page. You can use it to to update only the
|
page instead of reloading the entire page. You can use it to update only the
|
||||||
[[yii\grid\GridView|GridView]] content when using filters.
|
[[yii\grid\GridView|GridView]] content when using filters.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
@ -10,8 +10,7 @@ Yii uses a [[yii\data\Pagination]] object to represent the information about a p
|
|||||||
is usually much more than the number of data items needed to display on a single page.
|
is usually much more than the number of data items needed to display on a single page.
|
||||||
* [[yii\data\Pagination::$pageSize|page size]] specifies how many data items each page contains. The default
|
* [[yii\data\Pagination::$pageSize|page size]] specifies how many data items each page contains. The default
|
||||||
value is 20.
|
value is 20.
|
||||||
* [[yii\data\Pagination::$page|current page]] gives the current page number (zero-based). The default value
|
* [[yii\data\Pagination::$page|current page]] gives the current page number (zero-based). The default value is 0, meaning the first page.
|
||||||
value is 0, meaning the first page.
|
|
||||||
|
|
||||||
With a fully specified [[yii\data\Pagination]] object, you can retrieve and display data partially. For example,
|
With a fully specified [[yii\data\Pagination]] object, you can retrieve and display data partially. For example,
|
||||||
if you are fetching data from a database, you can specify the `OFFSET` and `LIMIT` clause of the DB query with
|
if you are fetching data from a database, you can specify the `OFFSET` and `LIMIT` clause of the DB query with
|
||||||
|
@ -77,7 +77,7 @@ public function behaviors()
|
|||||||
|
|
||||||
### CORS <span id="cors"></span>
|
### CORS <span id="cors"></span>
|
||||||
|
|
||||||
Adding the [Cross Origin Resource Sharing](structure-filters.md#cors) filter to a controller is a bit more complicated
|
Adding the [Cross-Origin Resource Sharing](structure-filters.md#cors) filter to a controller is a bit more complicated
|
||||||
than adding other filters described above, because the CORS filter has to be applied before authentication methods
|
than adding other filters described above, because the CORS filter has to be applied before authentication methods
|
||||||
and thus needs a slightly different approach compared to other filters. Also authentication has to be disabled for the
|
and thus needs a slightly different approach compared to other filters. Also authentication has to be disabled for the
|
||||||
[CORS Preflight requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests)
|
[CORS Preflight requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests)
|
||||||
|
@ -24,7 +24,7 @@ Content-Type: application/json; charset=UTF-8
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The following list summarizes the HTTP status code that are used by the Yii REST framework:
|
The following list summarizes the HTTP status codes that are used by the Yii REST framework:
|
||||||
|
|
||||||
* `200`: OK. Everything worked as expected.
|
* `200`: OK. Everything worked as expected.
|
||||||
* `201`: A resource was successfully created in response to a `POST` request. The `Location` header
|
* `201`: A resource was successfully created in response to a `POST` request. The `Location` header
|
||||||
|
@ -137,7 +137,7 @@ the request with `http://localhost/users?fields=id,email&expand=profile` may ret
|
|||||||
## Links <span id="links"></span>
|
## Links <span id="links"></span>
|
||||||
|
|
||||||
[HATEOAS](http://en.wikipedia.org/wiki/HATEOAS), an abbreviation for Hypermedia as the Engine of Application State,
|
[HATEOAS](http://en.wikipedia.org/wiki/HATEOAS), an abbreviation for Hypermedia as the Engine of Application State,
|
||||||
promotes that RESTful APIs should return information that allow clients to discover actions supported for the returned
|
promotes that RESTful APIs should return information that allows clients to discover actions supported for the returned
|
||||||
resources. The key of HATEOAS is to return a set of hyperlinks with relation information when resource data are served
|
resources. The key of HATEOAS is to return a set of hyperlinks with relation information when resource data are served
|
||||||
by the APIs.
|
by the APIs.
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ $param = $request->getBodyParam('id');
|
|||||||
## Request Methods <span id="request-methods"></span>
|
## Request Methods <span id="request-methods"></span>
|
||||||
|
|
||||||
You can get the HTTP method used by the current request via the expression `Yii::$app->request->method`.
|
You can get the HTTP method used by the current request via the expression `Yii::$app->request->method`.
|
||||||
A whole set of boolean properties are also provided for you to check if the current method is of certain type.
|
A whole set of boolean properties is also provided for you to check if the current method is of certain type.
|
||||||
For example,
|
For example,
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
Reference in New Issue
Block a user