当前位置: 首页>>代码示例>>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;未经允许,请勿转载。