under symfony/doctrine, i want to set to the form a value contained in an URL parameter
offer/registration/new?offer_id=23
public function executeNew(sfWebRequest $request)
{
// echo $request->gerParameter('offer_id');
// echoes 23
$this->form = $this->configuration->getForm();
$this->offer_registration = $this->form->getObject();
}
public function executeCreate(sfWebRequest $request)
{
// echo $request->gerParameter('offer_id');
// echoes nothing
$offer = new OfferRegistration();
$offer->setOfferId($offer_id);
$this->form = $this->configuration->getForm($offer);
$this->offer_registration = $this->form->getObject();
$this->processForm($request, $this->form);
$this->setTemplate('new');
}
How to pass the $offer_id between executeNew() and executeCreate() so that i can set the right OfferId on the form ?
PS: I precise that i'm working with a admin backend module