我使用Symfony1.4并推动我的应用程序。我有个问题。例如:我有一个数据库,我想在其中保存作者和书籍。我制定了以下方案: schema.yml
book:
id: ~
name: {type: varchar (100), required: true}
author:
id: ~
name: {type: varchar (100), required: true}
author_book:
id_book: {type: integer, foreignTable: book, foreignReference: id, required: true, primaryKey: true, onDelete: cascade}
id_author: {type: integer, foreignTable: author, foreignReference: id, required: true, primaryKey: true, onDelete: cascade}我想要添加作者,添加他写的书,而不是离开添加作者的页面。这是一个简单的问题,但由于某些原因,我没有找到解决方案。(我认为这可以通过编写一个小部件来实现,该小部件使用ajax加载“添加一本书”的表单,但是有没有现成的解决方案呢?)
发布于 2013-04-17 15:13:35
您可以使用sfForm::embedForm()嵌入多个表单。看看这个文档:http://symfony.com/legacy/doc/more-with-symfony/1_4/en/06-Advanced-Forms,它被解释了。
https://stackoverflow.com/questions/16042660
复制相似问题