JsonView.php (cakephp-4.2.2) | : | JsonView.php (cakephp-4.2.3) | ||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
* $this->viewBuilder()->setOption('serialize', true); | * $this->viewBuilder()->setOption('serialize', true); | |||
* ``` | * ``` | |||
* | * | |||
* The above would generate a JSON object that looks like: | * The above would generate a JSON object that looks like: | |||
* | * | |||
* `{"posts": [...], "users": [...]}` | * `{"posts": [...], "users": [...]}` | |||
* | * | |||
* You can also set `'serialize'` to a string or array to serialize only the | * You can also set `'serialize'` to a string or array to serialize only the | |||
* specified view variables. | * specified view variables. | |||
* | * | |||
* If you don't set the `serialize` opton, you will need a view template. | * If you don't set the `serialize` option, you will need a view template. | |||
* You can use extended views to provide layout-like functionality. | * You can use extended views to provide layout-like functionality. | |||
* | * | |||
* You can also enable JSONP support by setting `jsonp` option to true or a | * You can also enable JSONP support by setting `jsonp` option to true or a | |||
* string to specify custom query string parameter name which will contain the | * string to specify custom query string parameter name which will contain the | |||
* callback function name. | * callback function name. | |||
*/ | */ | |||
class JsonView extends SerializedView | class JsonView extends SerializedView | |||
{ | { | |||
/** | /** | |||
* JSON layouts are located in the JSON sub directory of `Layouts/` | * JSON layouts are located in the JSON sub directory of `Layouts/` | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |