Thanks for any help with this, I'm very new to the Symfony platform, so I'm just trying to plunge into it.
I want to be able to intercept the submitted form from the administration area and change the data.
Here is what I have so far (in basic form).
/apps/backend/modules/proposition/actions/action.class.php
class propositionActions extends autoPropositionActions { public function executeCreate(sfWebRequest $request) { // modify the name $name = $request->getParameter('name'); $name = $name . ' is an idiot'; $request->setParameter('name', $name); return parent::executeCreate($request); } }
My form contains a name field:
/apps/backend/modules/proposition/config/generator.yml
generator: class: sfDoctrineGenerator param: model_class: Proposition theme: admin non_verbose_templates: true with_show: false singular: ~ plural: ~ route_prefix: proposition with_doctrine_route: true actions_base_class: sfActions config: actions: ~ form: display: [name, icon, overview, published]
I'm not sure what you need this file, but it is definitely in HTML:
<input type="text" id="proposition_name" name="proposition[name]">
When I submit the form, it just saves my name. I want him to keep my name adding "idiot".
Thank you very much
source share