1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
//action.class.php
public function executeCreate(sfWebRequest $request)
{
$this->forward404Unless($request->isMethod('post'));
$this->form = new PricingForm();
$this->Tform = new TargetingForm();
$this->Cform = new AdsForm();
$this->processForm($request, $this->form, $this->Tform, $this->Cform);
$this->setTemplate('index');
}
public function processForm(sfWebRequest $request, sfForm $form, sfForm $Tform, sfForm $Cform)
{
$form->bind($request->getParameter('pubC'), NULL);
$Tform->bind($request->getParameter('pubT'), NULL);
$Cform->bind($request->getParameter('pub'), $request->getFiles('pub'));
if ($form->isValid() && $Tform->isValid() && $Cform->isValid())
{
....
}
} |
Partager