Common sense embedded forms for your symfony 1.4 project.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 10 commits ahead of kriswallsmith:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

This plugin allows you to embed related forms in a Doctrine form class, manipulate those embedded forms using JavaScript (i.e. add more, remove some, etc), and will automatically update those relations when the form is processed.

class AuthorForm extends BaseAuthorForm
  public function configure()

This form can now be rendered something like this, enhanced with JavaScript:

<form action="#" method="post">
  <!-- ... -->
    <?php foreach ($form['books'] as $bookFields): ?>
        <table><?php echo $bookFields ?></table>
        <a href="javascript:remove_book(this)">remove this book</a>
    <?php endforeach ?>
  <a href="javascript:add_book()">add another book</a>
  <!-- ... -->

Once your JavaScript is setup (which is up to you), your user can remove some of the listed books and add a few more. When you submit the form the database will be updated to reflect those changes.


  • The primary key of the related model must be "id"
  • The embedded form class must include an "id" field


  • Detect the related model's primary key
  • Obfuscate and add the primary key for embedded forms when needed