Submitting the form
Now that we have the form rendered on our template, we need to handle the application logic for submitting the form. The first step is to add the routing rules for our form page and its submission. The form sits within the signup module, and therefore, we will keep all of the functionality there too. Open the routing file apps/frontend/config/routing.yml, and add the following routes:
signup:
url: /signup
param: { module: signup, action: index}
signup_submit:
url: /signup/submit
param: { module: signup, action: submit}
Here we have created two rules, signup and signup_submit. The first rule will be routed to the index action and the second will be routed to the submit action in our signup module.
Next, we will create the submit action. Open up the actions class from apps/frontend/modules/signup/actions/actions.class.php and create the submit action:
public function executeSubmit(sfWebRequest $request)
{
$this->form = new NewsletterSignupForm();
if ($request->isMethod...