Git Product home page Git Product logo

Comments (4)

 avatar commented on May 27, 2024
/**
     * 创建用户
     * @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.

lixi0912 avatar lixi0912 commented on May 27, 2024

非常感谢您的回复,那对于没有约定的 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.

 avatar commented on May 27, 2024

如果没有约定key,只能遍历$._FILES了

from phpboot.

lixi0912 avatar lixi0912 commented on May 27, 2024

好的,谢谢

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.