【发布时间】:2016-04-09 21:49:48
【问题描述】:
我有以下模型:“货架”和“书”,处于 1:n 关系。
在书架列表中,我需要每个书架上的书籍数量。我怎样才能得到它?
在数据库表“Shelf”中有一个“books”列,其中包含我需要的编号。但是在模型中,“books”是一个 ObjectStorage,所以我无法通过这个属性获得子对象的计数。
在我的列表视图中,我有
<f:for each="{shelves}" as="shelf">
...
{shelf.books.0.title} //<-- this works perfectly returning title of first book
{shelf.books.count} //<-- this produces no output
【问题讨论】:
标签: typo3 parent-child extbase