本文整理汇总了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);
}
}
}
示例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;
}
}
}
示例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);
}
}
示例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');
}
}