【发布时间】:2011-06-13 10:25:48
【问题描述】:
我如何在 Symfony 1.4 和 Doctrine 中制作一个表格,将数据添加到两个表中? 默认 Symfony 为一个表和模块生成表单。在什么时候我可以编辑它并添加自己的字段? http://www.symfony-project.org/jobeet/1_4/Doctrine/en/03 生成。 例如,我想添加具有新类别的字段。
# config/doctrine/schema.yml
JobeetCategory:
actAs: { Timestampable: ~ }
columns:
name: { type: string(255), notnull: true, unique: true }
JobeetJob:
actAs: { Timestampable: ~ }
columns:
category_id: { type: integer, notnull: true }
(...)
expires_at: { type: timestamp, notnull: true }
relations:
JobeetCategory: { onDelete: CASCADE, local: category_id, foreign: id, foreignAlias: JobeetJobs }
此表单仅添加 id JobeetJob。我怎样才能添加到 JobeetCategory 中?
【问题讨论】:
标签: php symfony1 doctrine symfony-1.4 doctrine-1.2