Cover of the book Symfony 5: The Fast Track

Symfony 5: The Fast Track is the best book to learn modern Symfony development, from zero to production. +300 pages showcasing Symfony with Docker, APIs, queues & async tasks, Webpack, SPAs, etc.

sfDoctrinePlugin: Forms documentation and some updates

Chapter 11 of the symfony Forms Book focuses on how the sfDoctrinePlugin integrates with the symfony forms framework. The chapter is essentially a port of the Propel version and has updates for the differences between Propel and Doctrine syntax. The sfDoctrinePlugin is equal to sfPropelPlugin and implements all the same tasks and functionality. For those of you curious about what version of the plugin you should be using with symfony, check the plugin page or read below.


As of symfony 1.2, sfDoctrinePlugin is bundled with symfony so including it in your plugins folder is no longer necessary.

What is next?

  • The symfony and Doctrine Book
  • PEAR packages for 1.0 and 1.1
  • Continued maintenance of the plugin for 1.0(gnat42), 1.1(me) and 1.2(me)

If you're interesting in helping maintain the plugin for your version of symfony, feel free to reach out to me.

Help the Symfony project!

As with any Open-Source project, contributing code or documentation is the most common way to help, but we also have a wide range of sponsoring opportunities.


Awesome 0o

Great one.
What I like most about Doctrine-powered forms is summed up in this sentence "When a Doctrine form is valid, the save() method updates the related object and stores it in the database."

In clear, you can have a sfGuard form, define a relationship to your UserProfile model, name it "Profile", then you can just embed the UserProfileForm under the name "Profile" ($this->embedForm('Profile', new UserProfileForm())) in a registration form for instance, and a call to save() will automatically save the profile data into the UserProfile table. This is incredibly powerful..
I'm just curious as to why the doctrine form generators are not as grainular as they could be. For example, Doctrine offers many types of column validation, it would be nice if the generators took advantage of this. I would be willing to put some time into this if it's not already planned for 1.2. Also, this maybe an over site on my part by why not just use Doctrines model validators to check for valid data. Maybe it's because symfony wishes to abstract validation. Thoughts would be appreciated.

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.