Embed forms in Symfony

霸气de小男生 提交于 2019-12-11 08:53:53

问题


I've added a profile class to sfDoctrineGuard, and in the admin I'm trying to edit the profile part while editing the user, using embed forms as explained here:

http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin

Editing users works, but when I add

"User": [username, password, password_again, Profile]

All I get is an error message :

Widget "Profile" does not exist.

Any help would be appreciated. Is the blog post out of date ?


回答1:


There's a nice neat way to do this now.... Are you using 1.3 or 1.4?

In UserForm:

public function configure()
{
    $this->embedRelation('Profile');
}

Assuming that your schema is set up correctly, this will embed the form.



来源:https://stackoverflow.com/questions/3934687/embed-forms-in-symfony

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!