Comments (4)
/**
* 创建用户
* @route({"POST","/"}) 新建用户
* @param({"account", "$._POST.mobile"}) 手机号,必选
* @param({"password", "$._POST.password"}) 密码,必选
* @param({"alias", "$._POST.alias"}) 昵称,必选
* @param({"avatar", "$._FILES.avatar.tmp_name"}) 头像文件,可选
* @param({"ngtoken", "$._COOKIE.ngtoken"}) 验证短信验证码后获取的cookie
*/
public function createUser($ngtoken, $account, $alias, $password, $avatar = null){
//通过 $avatar 获取当前头像文件路径
}
对应前端上传上传代码
<form enctype="multipart/form-data" action="__URL__" method="POST">
mobile: <input type="text" name="mobile" />
password: <input type="password" name="password" />
alias: <input type="text" name="alias" />
avatar:<input name="avatar" type="file" />
<input type="submit" value="OK" />
</form>
from phpboot.
非常感谢您的回复,那对于没有约定的 key ,能否支持呢?比如多图的情况,我不知道会有多少张图,并且不知道 key 是什么~ 有什么好的写法吗?
还是要用原生的写法呢(遍历 $_FILES )?
2016-06-27 18:20 GMT+08:00 cayman [email protected]:
/** * 创建用户 * @route({"POST","/"}) 新建用户 * @param({"account", "$._POST.mobile"}) 手机号,必选 * @param({"password", "$._POST.password"}) 密码,必选 * @param({"alias", "$._POST.alias"}) 昵称,必选 * @param({"avatar", "$._FILES.avatar.tmp_name"}) 头像文件,可选 * @param({"ngtoken", "$._COOKIE.ngtoken"}) 验证短信验证码后获取的cookie */ public function createUser($ngtoken, $account, $alias, $password, $avatar = null){ //通过 $avatar 获取当前头像文件路径 }
对应前端上传上传代码
mobile: password: alias: avatar:—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AG3xAVeHcD9j1FF9wAsM_nVLwWXYmkGZks5qP6P_gaJpZM4I-4qT
.
from phpboot.
如果没有约定key,只能遍历$._FILES了
from phpboot.
好的,谢谢
2016-06-28 9:35 GMT+08:00 cayman [email protected]:
如果没有约定key,只能遍历$._FILES了
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AG3xAWNh3A_B3e354hqEyY-7W61aUsiMks5qQHpygaJpZM4I-4qT
.
from phpboot.
Related Issues (20)
- 路由算法需要增加严格匹配模式 HOT 13
- Exceptions throwed by hook, can't be catched. HOT 1
- create \PDO with IoCFactory failed
- cannot extract the “0” node from url path
- how to create the database table for example/users? HOT 1
- 如何自定义配置段 HOT 1
- 求助,"error":"phprs\\util\\exceptions\\NotFound","message HOT 1
- How about add 401 unAuth error response HOT 2
- 想做一个签名校验 HOT 2
- undue sql wrap with ``
- 有版本功能吗? HOT 2
- 想问一下如何添加根据路径的hook HOT 1
- 找不到类的报错 HOT 2
- Class App\Controllers\Books does not exist HOT 1
- 请问RPC调用如何设置超时时间?
- 支持mongodb数据库吗 HOT 2
- 关于APC扩展
- How to access custom values defined in config.php
- conf.json 可能泄漏 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpboot.