Answer the question
In order to leave comments, you need to log in
Symfony 1.4, How to store form data in two tables?
I used the auto-generator of forms and models on symfony - but the peculiarity is that they generate forms for each model separately, and if the form needs to save data in two tables (I have this - blog entry data and several pictures for this entry), then already having problems - because the form does not generate fields for images - only for the data in the table Posts in the blog.
For now, I need to study symfony 1.4 , I'll switch to the second later (or maybe I won't - it doesn't depend on me).
Answer the question
In order to leave comments, you need to log in
Embedded forms must be included manually in the form class:
<?php
// lib/form/doctrine/PostForm.class.php
public function configure()
{
//...
$this->embedRelation('images'); // где "images" - имя связи
}
In another framework for this, I saw nested forms.
It is unlikely that you will find people here who have caught the days of Symfony 1 and remember how this is done.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question