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


PHP sfForm::setValue方法代码示例

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


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

示例1: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         $form->setValue('account_id', $this->getUser()->getAttribute('account_id'));
         $time_item_type = $form->save();
         $this->getUser()->setFlash('saved.success', 1);
         $this->redirect('adminTimeItemType/edit?id=' . $time_item_type->getId());
     }
 }
开发者ID:newZinc,项目名称:timehive,代码行数:10,代码来源:actions.class.php

示例2: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
     if ($form->isValid()) {
         $form->setValue('account_id', $this->getUser()->getAttribute('account_id'));
         $role = $form->save();
         unset($role->Credentials);
         $role->save();
         foreach ($request->getParameter('credential') as $credential_id => $value) {
             $roleCredential = new RoleCredential();
             $roleCredential->role_id = $role->id;
             $roleCredential->credential_id = $credential_id;
             $roleCredential->save();
         }
         $this->getUser()->setFlash('saved.success', 1);
         $this->redirect('adminRole/edit?id=' . $role->getId());
     }
 }
开发者ID:newZinc,项目名称:timehive,代码行数:18,代码来源:actions.class.php

示例3: processForm

 protected function processForm(sfWebRequest $request, sfForm $form)
 {
     $parameters = $request->getParameter($form->getName());
     $form->bind($parameters, $request->getFiles($form->getName()));
     if ($form->isValid()) {
         $this->getContext()->getConfiguration()->loadHelpers('Number');
         // On crée la transaction correspondante
         $transaction = new Transaction();
         $transaction->asso_id = $parameters['asso_id'];
         $transaction->compte_id = $parameters['compte_id'];
         $transaction->libelle = 'Remboursement ' . $parameters['nom'];
         $transaction->commentaire = "Remboursement des achats suivants :\n";
         // Voir ci-dessous
         $transaction->montant = 0;
         // On fera le total plus tard !
         $transaction->date_transaction = date('Y-m-d');
         $transaction->moyen_id = $parameters['moyen_id'];
         $transaction->moyen_commentaire = $parameters['moyen_commentaire'];
         $transaction->save();
         $form->setValue('transaction_id', $transaction->getPrimaryKey());
         $note_de_frais = $form->save();
         foreach ($parameters['transactions'] as $transaction_id) {
             $transaction2 = $note_de_frais->addAchatFromId($transaction_id);
             $transaction->commentaire .= $this->format_transaction($transaction2) . "\n";
         }
         $transaction->save();
         $this->redirect('ndf', $note_de_frais->getAsso());
     }
 }
开发者ID:TheoJD,项目名称:portail,代码行数:29,代码来源:actions.class.php

示例4: processForm

 protected function processForm(sfWebRequest $request, sfForm $form, $emetteur, $asso)
 {
     $parameters = $request->getParameter($form->getName());
     $form->bind($parameters, $request->getFiles($form->getName()));
     if ($form->isValid()) {
         $montant = abs($parameters['montant']);
         var_dump(Doctrine);
         $t = new Transaction();
         // Transaction côté asso
         $t_e = new Transaction();
         // Transaction côté pôle
         // Asso
         $t->Asso = $asso;
         $t_e->Asso = $emetteur;
         // Compte
         $t->compte_id = $parameters['asso_compte_id'];
         $t_e->compte_id = $parameters['emetteur_compte_id'];
         // Libellé
         $t_e->libelle = sprintf('Avance de Trésorie %s', $asso->getName());
         $t->libelle = sprintf('Avance de Trésorie %s', $emetteur->getName());
         $t_e->montant = -($t->montant = $montant);
         $t_e->commentaire = $t->commentaire = $parameters['commentaire'];
         $t->moyen_id = $t_e->moyen_id = $parameters['moyen_id'];
         $t->moyen_commentaire = $t_e->moyen_commentaire = $parameters['moyen_commentaire'];
         $t->date_transaction = $t_e->date_transaction = date('Y-m-d');
         $t->save();
         $t_e->save();
         $form->setValue('transaction_emetteur_id', $t_e);
         $form->setValue('transaction_id', $t);
         $form->setValue('asso_id', $asso->getPrimaryKey());
         $avance_treso = $form->save();
         $this->redirect('avances', $emetteur);
     }
 }
开发者ID:TheoJD,项目名称:portail,代码行数:34,代码来源:actions.class.php


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