Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

SymfonyCasts

Symfony 3 Forms: Build, Render & Conquer!

via SymfonyCasts

Overview

Ah, forms: one of the most powerful - but sometimes hated - features in all of Symfony. Here's the deal: forms are just plain hard. You need to manage the HTML form elements, validation, data transformation and a lot more. The Form component is probably the most complex part of Symfony. But the more you work with it, the more you'll like it.

In this episode, we'll learn how to use Symfony forms to handle simple situations as well as some complex setups. Most importantly, I'll show you how to avoid the pitalls that many developers often fall into that causes the form component to spiral into complexity hell. The form system is a tool: in this tutorial, we'll put the joy back into it:

  • Creating a basic form
  • Basic form rendering and customization
  • Handling a form submit
  • Backing your form with an entity
  • Adding validation
  • Form field guessing
  • Pre-filling with default data
  • Creating a form "type" class
  • Using forms to handle an API POST request
  • Understanding how forms really work
  • Flash messages

... and form tips and tricks stuck in all over!

Syllabus

  • The Form Type Class
  • Render that Form Pretty (Bootstrap)
  • Process that Form!
  • Binding Forms to Objects: data_class
  • Save, Redirect, setFlash (and Dance)
  • Field Types and Options
  • Custom Query in EntityType
  • Creating a Date Picker Field
  • Date Format & "Sanity" Validation
  • Form Rendering and Form Variables
  • Disable HTML5 Validation
  • Beautiful Form Validation
  • Changing Validation Messages
  • Easy Edit Form
  • Sharing Form Templates with include()

Taught by

Ryan Weaver and Leanna Pelham

Reviews

Start your review of Symfony 3 Forms: Build, Render & Conquer!

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.