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


PHP Request::setMethod方法代碼示例

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


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

示例1: getParameters

 static function getParameters()
 {
     Request::setMethod('GET');
     $gulliverId = Request::get('GID', "");
     $baseId = Request::get('BID', "");
     if ("" == $gulliverId) {
         return false;
     }
     if ("" == $baseId) {
         return false;
     }
     //
     $row = InsuranceModel::where('session', $gulliverId)->where('id', $baseId)->first()->toArray();
     self::$search = json_decode($row['search'], true);
     self::$item = json_decode($row['item'], true);
     unset($row);
     return;
 }
開發者ID:fcolella,項目名稱:docker,代碼行數:18,代碼來源:InsuranceController.php

示例2: validateParams

 /**
  * Read and validate variables from the url
  * used by results()
  * @return array
  **/
 static function validateParams()
 {
     //
     $errors = [];
     $date_min = str_replace('+', 'P', strtoupper(self::$config['mindate']));
     $date_max = str_replace('+', 'P', strtoupper(self::$config['maxdate']));
     //
     Request::setMethod('GET');
     //
     $origin = Request::get('origen', "");
     if ("" == $origin) {
         $errors[] = 'Debe elegir una ciudad de origen';
     }
     //
     $destination = Request::get('destino', "");
     if ("" == $destination) {
         $errors[] = 'Debe elegir una ciudad de destino';
     }
     //
     $dateFrom = Request::get('fecha-desde', "");
     if ("" == $dateFrom) {
         $errors[] = 'Debe elegir una fecha inicial para siu seguro';
     } else {
         $validDate = dateValidate($dateFrom, $date_min, $date_max);
         if (true !== $validDate) {
             if ('min' == $validDate) {
                 $errors[] = 'La fecha inicial no debe ser anterior a la fecha actual + 3 días';
             } else {
                 if ('max' == $validDate) {
                     $errors[] = 'La fecha inicial no debe ser mayor que 61 meses';
                 } else {
                     $errors[] = 'Debe elegir una fecha válida de inicio para su seguro';
                 }
             }
         }
     }
     //
     $dateTo = Request::get('fecha-hasta', "");
     if ("" == $dateFrom) {
         $errors[] = 'Debe elegir una fecha inicial para siu seguro';
     } else {
         $validDate = dateValidate($dateTo, $date_min, $date_max);
         if (true !== $validDate) {
             if ('min' == $validDate) {
                 $errors[] = 'La fecha final no debe ser anterior a la fecha actual + 3 días';
             } else {
                 if ('max' == $validDate) {
                     $errors[] = 'La fecha final no debe ser mayor que 12 meses';
                 } else {
                     $errors[] = 'Debe elegir una fecha válida de finalización del su seguro';
                 }
             }
         }
     }
     //
     $passengers = self::passengersParseUrl();
     if ([] == $passengers) {
         $errors[] = 'Debe especificar los pasajeros y sus edades';
     }
     //
     return ['errors' => $errors, 'search' => ['origin' => $origin, 'destination' => $destination, 'dateFrom' => $dateFrom, 'dateTo' => $dateTo, 'passengers' => $passengers]];
 }
開發者ID:fcolella,項目名稱:docker,代碼行數:67,代碼來源:InsuranceController.php

示例3: getFormData

 static function getFormData()
 {
     Request::setMethod('POST');
     self::$form = Request::all();
     #print_pre(self::$form);
     //  Small helpers
     $dataPago = explode('-', self::$form['data-pago']);
     self::$form['data-pago'] = ['tarjeta' => false == empty($dataPago[0]) ? $dataPago[0] : 0, 'sps' => false == empty($dataPago[1]) ? $dataPago[1] : '99', 'cuotas' => false == empty($dataPago[2]) ? $dataPago[2] : 0, 'banco' => false == empty($dataPago[3]) ? $dataPago[3] : 0];
     self::$form['selectedCard'] = self::getCardName(self::$form['data-pago']['tarjeta']);
     self::$form['selectedBank'] = self::getBankName(self::$form['data-pago']['banco']);
     self::$form['selectedBank'] = self::$form['selectedBank'] == 'Otros Bancos' ? self::$form['selectedBank'] : 'Banco ' . self::$form['selectedBank'];
     self::$form['ownCredit'] = env('CREDITO_GARBARINO_ID') == self::$form['data-pago']['banco'] ? 1 : 0;
     #print_pre(self::$form,0,0);
     /**
     		INSURANCE = Array(
     			[TotalAmount] => 323.93
     			[selectedBank] => Banco
     			[data-pago] => 1-00180412-12-2-
     			[precioFinal] => 373
     			[intereses] => 98
     			[bonificacion] => 49
     			[maxCargosGestion] => 0
     			[descCargosGestion] => 0
     			[coefDescuento] => 0
     			[Installment] => 1
     			[banco] => 2
     			[card] => Seleccioná una tarjeta
     			[traveler] => Array (
     				[0] => Array (
     					[nombre] => Test 1
     					[apellido] => Pasajero 1
     					[dia_nac] => 1
     					[mes_nac] => 1
     					[anio_nac] => 1970
     					[tipoDocumento] => DNI
     					[numeroDocumento] => 1234567891
     				)
     				[1] => Array(
     					[nombre] => Test 2
     					[apellido] => Pasajero 2
     					[dia_nac] => 2
     					[mes_nac] => 2
     					[anio_nac] => 1975
     					[tipoDocumento] => DNI
     					[numeroDocumento] => 1234567892
     				)
     			)
     			[emergencyContactsInfo] => Array(
     				[name] => Test
     				[lastname] => Emergencia
     				[phone] => 4787-7077
     			)
     			[provincia] => C
     			[stateName] => Ciudad de Buenos Aires
     			[localidad] => Buenos Aires
     			[matchedCity] => 1
     			[localityCode] => 20000
     			[subdivision] => Buenos Aires
     			[zipCode] => C1000
     			[domicilio] => Av. Cabildo
     			[altura] => 2025
     			[piso] => 1
     			[depto] => Al fondo
     			[clave] => CUIL
     			[cuil] => 23123456789
     			[email] => it@garbarinoviajes.com.ar
     			[telefono] => 4787-7077
     			[comentarios] => PRUEBA DESDE DESARROLLO
     			[condiciones] => on
     			[GID] => 64624cfb-9bf9-4b5d-8d29-bad8ee5c5bbe
     			[RID] => 43
     			[tester] => tester
     		)
     		**/
 }
開發者ID:fcolella,項目名稱:docker,代碼行數:75,代碼來源:BookingController.php


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