當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Input::put方法代碼示例

本文整理匯總了PHP中Input::put方法的典型用法代碼示例。如果您正苦於以下問題:PHP Input::put方法的具體用法?PHP Input::put怎麽用?PHP Input::put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Input的用法示例。


在下文中一共展示了Input::put方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: put_index

 public function put_index($id)
 {
     $put = json_decode(Input::put()['model'], true);
     $data = array('title' => $put['title'], 'domain' => $put['domain'], 'user' => $put['user'], 'pass' => $put['pass'], 'updated_at' => time());
     try {
         DB::update(Model_Site::table())->set($data)->where('id', '=', $id)->execute();
         return $this->response(array('ok' => true));
     } catch (Exception $e) {
         return $this->response(array('ok' => false, 'message' => $e->getMessage()), 500);
     }
 }
開發者ID:egapool,項目名稱:helthcrawler,代碼行數:11,代碼來源:sites.php

示例2: put_index

 public function put_index($siteId)
 {
     $put = json_decode(Input::put()['model'], true);
     if ($this->isExist($siteId)) {
         try {
             DB::transaction_start();
             DB::commit();
         } catch (Exception $e) {
             DB::rollback();
         }
     } else {
     }
 }
開發者ID:egapool,項目名稱:helthcrawler,代碼行數:13,代碼來源:urls.php

示例3: put_index

 /**
  * Updates a seller callback.
  *
  * @param int $seller_id Seller ID.
  * @param int $id        Seller callback ID.
  *
  * @return void
  */
 public function put_index($seller_id = null, $id = null)
 {
     $callback = $this->get_callback($id);
     $validator = \Validation_Seller_Callback::update();
     if (!$validator->run(\Input::put())) {
         throw new HttpBadRequestException($validator->errors());
     }
     $data = $validator->validated();
     $callback = \Service_Seller_Callback::update($callback, $data);
     if (!$callback) {
         throw new HttpServerErrorException();
     }
     $this->response($callback);
 }
開發者ID:mehulsbhatt,項目名稱:volcano,代碼行數:22,代碼來源:callbacks.php

示例4: put_index

 /**
  * Updates a seller contact.
  *
  * @param int $seller_id Seller ID.
  * @param int $id        Contact ID.
  *
  * @return void
  */
 public function put_index($seller_id = null, $id = null)
 {
     $contact = $this->get_contact($id);
     $validator = \Validation_Contact::update('seller');
     if (!$validator->run(\Input::put())) {
         throw new HttpBadRequestException($validator->errors());
     }
     $data = $validator->validated();
     $contact = \Service_Contact::update($contact, $data);
     if (!$contact) {
         throw new HttpServerErrorException();
     }
     $this->response($contact);
 }
開發者ID:mehulsbhatt,項目名稱:volcano,代碼行數:22,代碼來源:contacts.php

示例5: put_index

 /**
  * Updates a gateway.
  *
  * @param int $seller_id Seller ID.
  * @param int $id        Gateway ID.
  *
  * @return void
  */
 public function put_index($seller_id = null, $id = null)
 {
     $gateway = $this->get_gateway($id);
     $validator = \Validation_Gateway::update();
     if (!$validator->run(\Input::put())) {
         throw new HttpBadRequestException($validator->errors());
     }
     $data = $validator->validated();
     $gateway = \Service_Gateway::update($gateway, $data);
     if (!$gateway) {
         throw new HttpServerErrorException();
     }
     $this->response($gateway);
 }
開發者ID:mehulsbhatt,項目名稱:volcano,代碼行數:22,代碼來源:gateways.php

示例6: put_index

 /**
  * Updates a customer.
  *
  * @param int $id Customer ID.
  *
  * @return void
  */
 public function put_index($id = null)
 {
     $customer = $this->get_customer($id);
     $validator = \Validation_Customer::update();
     if (!$validator->run(\Input::put())) {
         throw new HttpBadRequestException($validator->errors());
     }
     $data = $validator->validated();
     $customer = \Service_Customer::update($customer, $data);
     if (!$customer) {
         throw new HttpServerErrorException();
     }
     $this->response($customer);
 }
開發者ID:mehulsbhatt,項目名稱:volcano,代碼行數:21,代碼來源:customers.php

示例7: put_index

 /**
  * Updates a payment method.
  *
  * @param int $customer_id Customer ID.
  * @param int $id          Payment method ID.
  *
  * @return void
  */
 public function put_index($customer_id = null, $id = null)
 {
     $customer = $this->get_customer($customer_id);
     $payment_method = $this->get_paymentmethod($id, $customer);
     $validator = \Validation_Customer_Paymentmethod::update($payment_method->gateway);
     if (!$validator->run(\Input::put())) {
         throw new HttpBadRequestException($validator->errors());
     }
     $data = $validator->validated();
     $payment_method = \Service_Customer_Paymentmethod::update($payment_method, $data);
     if (!$payment_method) {
         throw new HttpServerErrorException();
     }
     $this->response($payment_method);
 }
開發者ID:mehulsbhatt,項目名稱:volcano,代碼行數:23,代碼來源:paymentmethods.php

示例8: put_index

 /**
  * Updates a product option.
  *
  * @param int $product_id Product ID.
  * @param int $id         Product option ID.
  *
  * @return void
  */
 public function put_index($product_id = null, $id = null)
 {
     $product = $this->get_product($product_id);
     $option = $this->get_option($id, $product);
     $validator = \Validation_Product_Option::update();
     if (!$validator->run(\Input::put())) {
         throw new HttpBadRequestException($validator->errors());
     }
     $data = $validator->validated();
     $option = \Service_Product_Option::update($option, $data);
     if (!$option) {
         throw new HttpServerErrorException();
     }
     $this->response($option);
 }
開發者ID:mehulsbhatt,項目名稱:volcano,代碼行數:23,代碼來源:options.php

示例9: PUT_infoAction

 /**
  * 修改信息
  * @param [type] $id [description]
  * @todo 價格
  */
 public function PUT_infoAction($id)
 {
     $this->authPrinter($id);
     $info = [];
     /*店名*/
     Input::put('name', $var, 'title') and $info['name'] = $var;
     /*郵箱*/
     Input::put('email', $var, 'email') and $info['email'] = $var;
     /*手機*/
     Input::put('phone', $var, 'phone') and $info['phone'] = $var;
     /*qq號*/
     Input::put('qq', $var, 'int') and $info['qq'] = $var;
     /*微信號*/
     Input::put('wechat', $var, 'char_num') and $info['wechat'] = $var;
     /*地址*/
     Input::put('address', $var, 'text') and $info['address'] = $var;
     /*簡介*/
     Input::put('profile', $var, 'text') and $info['profile'] = $var;
     /*營業時間*/
     Input::put('open', $var, 'text') and $info['open'] = $var;
     /*營業時間*/
     Input::put('other', $var, 'text') and $info['other'] = $var;
     /*價格*/
     $price = [];
     Input::put('price_s', $price['s'], 'float');
     Input::put('price_d', $price['d'], 'float');
     Input::put('price_c_s', $price['c_s'], 'float');
     Input::put('price_c_d', $price['c_d'], 'float');
     if (!empty(array_filter($price))) {
         if ($oldprice = PrinterModel::where('id', $id)->get('price')) {
             if ($oldprice = @json_decode($oldprice, true)) {
                 $price = array_merge($oldprice, array_filter($price));
             }
         }
         $info['price'] = json_encode($price);
     }
     if (empty($info)) {
         $this->response(0, '無有效參數');
     } elseif (PrinterModel::where('id', $id)->update($info) !== false) {
         $this->response(1, $info);
     } else {
         $this->response(0, '修改失敗');
     }
 }
開發者ID:derek-chow,項目名稱:YunYinService,代碼行數:49,代碼來源:Info.php

示例10: PUT_infoAction

 /**
  * 修改狀態
  * @param [type] $id [description]
  */
 public function PUT_infoAction($id)
 {
     $pid = $this->authPrinter();
     $response['status'] = 0;
     if (!Input::put('status', $status, 'int')) {
         $response['info'] = '無效狀態';
     } elseif ($status < -1 || $status > 5) {
         $response['info'] = '此狀態不允許設置';
     } elseif ($status == -1 && TaskModel::where('id', intval($id))->where('pri_id', $pri_id)->get('payed')) {
         //取消訂單
         $response['info'] = '已支付暫不支持線上取消';
     } elseif (TaskModel::where('id', intval($id))->where('pri_id', $pid)->update(['status' => $status])) {
         $response['status'] = 1;
         $response['info'] = '修改成功';
     } else {
         $response['info'] = '狀態設置失敗';
     }
     $this->response = $response;
 }
開發者ID:derek-chow,項目名稱:YunYinService,代碼行數:23,代碼來源:Task.php

示例11: put_index

 /**
  * Updates a seller.
  *
  * @param int $id Seller ID.
  *
  * @return void
  */
 public function put_index($id = null)
 {
     if (!$id) {
         throw new HttpNotFoundException();
     }
     $seller = \Service_Seller::find_one($id);
     if (!$seller || $seller != \Seller::active()) {
         throw new HttpNotFoundException();
     }
     $validator = \Validation_Seller::update();
     if (!$validator->run(\Input::put())) {
         throw new HttpBadRequestException($validator->errors());
     }
     $data = $validator->validated();
     $seller = \Service_Seller::update($seller, $data);
     if (!$seller) {
         throw new HttpServerErrorException();
     }
     $this->response($seller);
 }
開發者ID:mehulsbhatt,項目名稱:volcano,代碼行數:27,代碼來源:sellers.php

示例12: action_index

 /**
  * This is a test page to test basic curl requests and responses.
  * @return mixed
  */
 public function action_index()
 {
     try {
         //init data response
         $data = array();
         //get url
         $data['url'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
         //get method
         $data['method'] = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '';
         //get params
         $data['params']['get'] = \Input::get();
         $data['params']['post'] = \Input::post();
         $data['params']['put'] = \Input::put();
         $data['params']['delete'] = \Input::delete();
         //return response
         $this->response(array('data' => $data));
     } catch (\Exception $e) {
         //return caught exceptions to json response
         $this->response(array('exception' => $e->getMessage()));
     }
 }
開發者ID:socialskeptic,項目名稱:sainsburys,代碼行數:25,代碼來源:curl.php

示例13: PUT_indexAction

 /**
  * 重置密碼
  * @method POST_printerAction
  * @author NewFuture
  */
 public function PUT_indexAction($id)
 {
     $this->auth($id);
     $response['status'] = 0;
     if (!Input::put('password', $password, 'isMd5')) {
         $response['info'] = '新的密碼格式不對';
     } elseif (!Input::put('old', $old_pwd, 'isMd5')) {
         $response['info'] = '請輸入原密碼';
     } else {
         /*數據庫中讀取用戶數據*/
         $printer = PrinterModel::field('password,account')->find($id);
         $account = $printer['account'];
         if (!$printer || Encrypt::encryptPwd($old_pwd, $account) != $printer['password']) {
             $response['info'] = '原密碼錯誤';
         } elseif ($printer->update(['password' => Encrypt::encryptPwd($password, $account)]) >= 0) {
             $response['info'] = '修改成功';
             $response['status'] = 1;
         } else {
             $response['info'] = '修改失敗';
         }
     }
     $this->response = $response;
 }
開發者ID:derek-chow,項目名稱:YunYinService,代碼行數:28,代碼來源:Password.php

示例14: PUT_emailAction

 /**
  * 修改用戶郵箱
  * PUT /user/1/phone {code:"C09Eaf"}
  * @method GET_infoAction
  * @param  integer        $id [description]
  * @author NewFuture
  */
 public function PUT_emailAction($id = 0)
 {
     $id = $this->auth($id);
     $response['status'] = 0;
     $Code = new Model('code');
     if (!Input::put('code', $code, 'ctype_alnum')) {
         $response['info'] = '驗證碼格式不對';
     } elseif (!$Code->where('use_id', $id)->where('type', 1)->field('id,time,code,content')->find()) {
         $response['info'] = '驗證信息不存在';
     } elseif (!Safe::checkTry('email_code_' . $id)) {
         $Code->delete();
         Safe::del('email_code_' . $id);
         $response['info'] = '嘗試次數過多,請重新驗證';
     } elseif (strtoupper($code) != strtoupper(substr($Code['code'], -6))) {
         $response['info'] = '驗證碼不匹配';
     } elseif (!UserModel::saveEmail($Code['content'], $Code['use_id'])) {
         $response['info'] = '郵箱綁定失敗';
     } else {
         $Code->delete();
         Safe::del('email_code_' . $id);
         $response['info'] = $Code['content'];
         $response['status'] = 1;
     }
     $this->response = $response;
 }
開發者ID:derek-chow,項目名稱:YunYinService,代碼行數:32,代碼來源:User.php

示例15: PUT_infoAction

 /**
  * 獲取詳情
  * PUT /books/123
  * @method GET_infoAction
  * @param  integer        $id [資源id]
  * @author NewFuture
  */
 public function PUT_infoAction($id = 0)
 {
     $pid = $this->authPrinter();
     $book = [];
     if (Input::put('name', $name, 'title')) {
         $book['name'] = $name;
     }
     if (Input::put('detail', $detail, 'text')) {
         $book['detail'] = $detail;
     }
     if (Input::put('price', $price, 'float')) {
         $book['price'] = $price;
     }
     if (empty($book)) {
         $this->response(0, '無修改內容');
     } elseif (BookModel::where('id', $id)->where('pri_id', $pid)->update($book)) {
         $this->response(1, $book);
     } else {
         $this->response(0, '修改失敗');
     }
 }
開發者ID:derek-chow,項目名稱:YunYinService,代碼行數:28,代碼來源:Books.php


注:本文中的Input::put方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。