当前位置: 首页>>代码示例>>PHP>>正文


PHP sfWebRequest::ismethod方法代码示例

本文整理汇总了PHP中sfWebRequest::ismethod方法的典型用法代码示例。如果您正苦于以下问题:PHP sfWebRequest::ismethod方法的具体用法?PHP sfWebRequest::ismethod怎么用?PHP sfWebRequest::ismethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sfWebRequest的用法示例。


在下文中一共展示了sfWebRequest::ismethod方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeConnexion

 public function executeConnexion(sfWebRequest $request)
 {
     $class = sfConfig::get('app_sf_guard_plugin_signin_form', 'sfGuardFormSignin');
     $this->formIdentification = new $class();
     if ($request->ismethod('post')) {
         $this->formIdentification->bind($request->getParameter('signin'));
         if ($this->formIdentification->isValid()) {
             $values = $this->formIdentification->getValues();
             $this->getUser()->signin($values['user'], array_key_exists('remember', $values) ? $values['remember'] : false);
             $paypal = new PayPal();
             $ret = $paypal->doExpressCheckout($this->getUser()->getAttribute('montantLocation'), 'Location de la voiture');
             //print_r($ret);
         }
     }
 }
开发者ID:sfinx13,项目名称:appsmartproject,代码行数:15,代码来源:actions.class.php

示例2: executeAmende

 public function executeAmende(sfWebRequest $request)
 {
     $this->formContravention = new ContrevenantForm();
     if ($request->ismethod('post')) {
         $this->formContravention->bind($request->getParameter('contrevenant'));
         if ($this->formContravention->isValid()) {
             $param = $request->getParameter('contrevenant');
             $numImmatriculation = $param['num_immatriculation'];
             $dateContravention = $param['date_contravention']['year'] . '-' . $param['date_contravention']['month'] . '-' . $param['date_contravention']['day'];
             $heureContravention = $param['heure_contravention']['hour'] . ':' . $param['heure_contravention']['minute'];
             $listContrevenant = $this->getLocation($numImmatriculation, $dateContravention, $heureContravention);
             //print_r($listContrevenant);
             if (count($listContrevenant) == 0) {
                 $this->listContrevenant = null;
             } else {
                 $this->listContrevenant = $listContrevenant;
             }
         } else {
             $this->listContrevenant = null;
         }
     }
 }
开发者ID:sfinx13,项目名称:appsmartproject,代码行数:22,代码来源:actions.class.php

示例3: executeIdentification

 public function executeIdentification(sfWebRequest $request)
 {
     if (!$this->getUser()->isAuthenticated()) {
         $this->formInscription = new InscriptionForm();
         $class = sfConfig::get('app_sf_guard_plugin_signin_form', 'sfGuardFormSignin');
         $this->form = new $class();
         if ($request->ismethod('post')) {
             if ($request->getParameter('send') == "signin") {
                 $this->form->bind($request->getParameter('signin'));
                 if ($this->form->isValid()) {
                     $values = $this->form->getValues();
                     $this->getUser()->signin($values['user'], array_key_exists('remember', $values) ? $values['remember'] : false);
                     if ($this->getUser()->getAttribute('montantLocation')) {
                         $paypal = new PayPal();
                         $ret = $paypal->doExpressCheckout($this->getUser()->getAttribute('montantLocation'), 'Location de la voiture');
                         print_r($ret);
                     } else {
                         $this->redirect('espace_membre_profil');
                     }
                 }
             } else {
                 if ($request->getParameter('send') == "signup") {
                     $this->formInscription->bind($request->getParameter('signup'));
                     if ($this->formInscription->isValid()) {
                         $values = $this->formInscription->getValues();
                         //print_r($values);
                         //exit;
                         $user = new sfGuardUser();
                         $user->setEmailAddress($values['email_address']);
                         $user->setUsername($values['email_address']);
                         $user->setLastName($values['nom']);
                         $user->setFirstName($values['prenom']);
                         $user->setPassword($values['password1']);
                         $user->setIsActive(1);
                         $user->getProfile()->setAdresse($values['adresse']);
                         $user->getProfile()->setCodepostal($values['codepostal']);
                         $user->getProfile()->setVille($values['ville']);
                         $user->getProfile()->setFixe($values['fixe']);
                         $user->getProfile()->setMobile($values['mobile']);
                         $user->getProfile()->setDateNaissance($values['date_naissance']);
                         $user->getProfile()->setNumeroPermis($values['numero_permis']);
                         $user->getProfile()->setVilleDelivrance($values['ville_permis']);
                         $user->getProfile()->setPaysDelivrance($values['pays_permis']);
                         $user->getProfile()->setDateDelivrance($values['date_delivrance_permis']);
                         $user->getProfile()->setIsActivated(1);
                         $user->addGroupByName("client");
                         $user->save();
                         $this->getUser()->setAttribute('email_address', $values['email_address']);
                         $message = $this->getMailer()->compose(sfConfig::get('app_mail_saidi'), $values['email_address'], '[Mobilyrent] - Inscription Mobilyrent location de voiture', '[Mobilyrent] - Inscription Mobilyrent location de voiture');
                         $this->getMailer()->send($message);
                         //echo $this->getUser()->getAttribute('montantLocation');exit;
                         if ($this->getUser()->getAttribute('montantLocation')) {
                             $paypal = new PayPal();
                             $ret = $paypal->doExpressCheckout($this->getUser()->getAttribute('montantLocation'), 'Location de la voiture');
                             print_r($ret);
                         }
                         //$this->getUser()->setFlash('notice', sprintf('Inscription terminée.<br/>Un email vous a été envoyé. Connectez vous et continuer votre reservation.'));
                     }
                 }
             }
         }
     } else {
         $paypal = new PayPal();
         $ret = $paypal->doExpressCheckout($this->getUser()->getAttribute('montantLocation'), 'Location de la voiture');
         print_r($ret);
     }
 }
开发者ID:sfinx13,项目名称:appsmartproject,代码行数:67,代码来源:_actions.class.php

示例4: executeIdentification

 public function executeIdentification(sfWebRequest $request)
 {
     //Si non authentifie
     if (!$this->getUser()->isAuthenticated()) {
         $this->formInscription = new InscriptionForm();
         $class = sfConfig::get('app_sf_guard_plugin_signin_form', 'sfGuardFormSignin');
         $this->form = new $class();
         if ($request->ismethod('post')) {
             if ($request->getParameter('send') == "signin") {
                 $this->form->bind($request->getParameter('signin'));
                 if ($this->form->isValid()) {
                     $values = $this->form->getValues();
                     $this->getUser()->signin($values['user'], array_key_exists('remember', $values) ? $values['remember'] : false);
                     if ($this->getUser()->getAttribute('montantLocation')) {
                         $contratMobilyrent = $this->ajouterContrat();
                         $this->ajouterLocation($contratMobilyrent);
                         $this->setPlanning();
                         $this->envoyerEmail();
                         $this->redirect('espace_membre_profil');
                     } else {
                         $this->redirect('espace_membre_profil');
                     }
                 }
             } else {
                 if ($request->getParameter('send') == "signup") {
                     $this->formInscription->bind($request->getParameter('signup'));
                     if ($this->formInscription->isValid()) {
                         $values = $this->formInscription->getValues();
                         $sfGuarduser = $this->ajouterUtilisateur($values);
                         $this->getUser()->signin($sfGuarduser, false, null);
                         if ($this->getUser()->getAttribute('montantLocation')) {
                             $contratMobilyrent = $this->ajouterContrat();
                             $this->ajouterLocation($contratMobilyrent);
                             $this->setPlanning();
                             $this->envoyerEmailInscription($values);
                             $this->envoyerEmail();
                             $this->redirect('espace_membre_profil');
                         } else {
                             //                        $message = $this->getMailer()->compose(sfConfig::get('app_mail_saidi'),
                             //                        $values['email_address'],
                             //                        '[Mobilyrent] - Inscription Mobilyrent location de voiture',
                             //                        '<p style="font-size:14px">Bonjour,<br/>
                             //                            Votre inscription Mobilyrent a bien été prise en compte.<br/>
                             //                            Vous pouvez dorénavant vous connecter.<br/><br/>Cordialement<br/>Mobilyrent<br/>Place des fetes<br/>75019 Paris<br/></p>'
                             //                        );
                             //                        $message->setContentType('text/html');
                             //                        $this->getMailer()->send($message);
                             $this->envoyerEmailInscription($values);
                         }
                         $this->redirect('espace_membre_profil');
                     }
                 }
             }
         }
     } else {
         $contratMobilyrent = $this->ajouterContrat();
         $this->ajouterLocation($contratMobilyrent);
         $this->setPlanning();
         $this->envoyerEmail();
         $this->getUser()->setFlash('notice', 'Un email vous a été envoyé');
         $this->redirect('espace_membre_profil');
     }
 }
开发者ID:sfinx13,项目名称:appsmartproject,代码行数:63,代码来源:actions.class.php


注:本文中的sfWebRequest::ismethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。