Answer the question
In order to leave comments, you need to log in
FosUserBundle: profile editing in different forms?
Good day to all!
Tell me how to implement editing profile attributes in different forms? Those. I need to have multiple edit forms like "name", "phone and address" and so on.
I found something similar in the documentation symfony.com/doc/current/cookbook/form/form_collect...
But maybe there is a simpler algorithm?
Answer the question
In order to leave comments, you need to log in
What you found is a collection of entities, that is, using this mechanism, you can add several new entities at once, on one form (for example, several new tags at once)
As far as I understand, you just need to edit one entity, but in different places of the application with different sets of attributes. Just use multiple forms.
class FirstEditForm extends .....
{
public function build($builder) {
$builder->add('username');
}
}
class SecondEditForm extends .....
{
public function build($builder) {
$builder->add('location');
$builder->add('number');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question