最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
cakephp 获取、设置表单值学习笔记
时间:2022-06-25 00:58:40 编辑:袖梨 来源:一聚教程网
cakephp中,不允许直接修改$this->request->data
但是可以用下面的方式设置
| 代码如下 | 复制代码 |
|
//取值 $this->request->data('Post.title'); //设置新值到data中 $this->request->data('Post.title', 'New post!'); |
|
/**
* Provides a read/write accessor for `$this->data`. Allows you
* to use a syntax similar to `CakeSession` for reading post data.
*
* ## Reading values.
*
* `$request->data('Post.title');`
*
* When reading values you will get `null` for keys/values that do not exist.
*
* ## Writing values
*
* `$request->data('Post.title', 'New post!');`
*
* You can write to any value, even paths/keys that do not exist, and the arrays
* will be created for you.
*
* @param string $name,... Dot separated name of the value to read/write
* @return mixed Either the value being read, or this so you can chain consecutive writes.
*/
相关文章
- 巨量百应官网登录入口-巨量百应官网直达网址 02-14
- 浏览器网页版入口直达-主流浏览器官网在线版一键访问 02-14
- 歪歪漫画秋蝉最新入口-秋蝉漫画免费下拉式阅读官网 02-14
- siliconflow官网登录-硅基流动官方入口网址 02-14
- 樱花动漫软件下载安装免费最新版-樱花动漫官方APP正版下载入口安卓版 02-14
- 免费视频bgm大全软件下载-免费视频bgm软件大全 02-14