i have in Doctrine 1.2:
User:
columns:
login: { type: string(255), notnull: true }
password: { type: string(255), notnull: true }
Student:
columns:
user_id: { type: integer, notnull: true }
school_name: { type: string(255) }
school_year: { type: integer(4) }
relations:
User: { onDelete: CASCADE, local: user_id, foreign: id }
Teacher:
columns:
user_id: { type: integer, notnull: true }
city: { type: string(255) }
street: { type: string(255) }
relations:
User: { onDelete: CASCADE, local: user_id, foreign: id }
if i open localhost/user/new have in form:
login:
password:
this is good.
if i open localhost/student/new have in form:
user_id
school_name:
school_year:
but i would like:
login:
password:
school_name:
school_year:
how to do this? thanks for help!
You have to use a sfForm method called embedRelation. You have to create a new form extending userForm and set (in the configure method) the embed relation with Student.
For example:
Check this example that explains perfectly how to use it.