开发者

Embed forms in Symfony

开发者 https://www.devze.com 2023-01-19 20:29 出处:网络
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:

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

Embed forms in Symfony

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.

A开发者_运维知识库ny help would be appreciated. Is the blog post out of date ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号