Created
May 5, 2010 11:39
-
-
Save docteurklein/390672 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOW TO : | |
- Déclarer les composants dans modules.yml | |
- Créer une page (form) et y ajouter le widget Form. | |
- Créer une sous-page ( edition) de celle citée juste au dessus et y ajouter le widget Edit. | |
- aller a l'URL : /form/edition?id=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** edit an existing object **/ | |
public function executeEditWidget(dmWebRequest $request) | |
{ | |
$this->form = $this->forms['AmapFrontForm'] = new AmapFrontForm(Doctrine::getTable('Amap')->find($request->getParameter('id'))); | |
if($request->isMethod('post') and $this->form->bindAndValid($request)) | |
{ | |
$this->form->save(); | |
$this->redirect('/mes-amaps'); | |
} | |
} | |
/** create a new object **/ | |
public function executeFormWidget(dmWebRequest $request) | |
{ | |
$form = $this->forms['AmapFront'] = new AmapFrontForm(Doctrine::getTable('Amap')->find($request->getParameter('id'))); | |
if ($request->isMethod('post') && $form->bindAndValid($request)) { | |
if($amap = $form->save()) { | |
dm::enableMailer(); | |
$this->getMailer()->composeAndSend('...') | |
); | |
} | |
$this->redirect('/inscription-amap-merci'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sureremnt ameliorable | |
public function executeEdit() | |
{ | |
$this->form = $this->forms['AmapFrontForm']; | |
} | |
public function executeForm() | |
{ | |
$this->form = $this->forms['AmapFront']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Amapy: | |
Amap: | |
page: true | |
components: | |
show: | |
form: | |
edit: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment