在前端显示 xml 数据
是否可以从缓存的 xml 文件中获取数据,然后在前端显示它们?
我正在考虑在 TYPO3 扩展中及其域模型(和 getter/setter)中执行此操作,但没有数据库表。然后用 SimpleXML 填充数据只是为了将它们“存储”在内存中。至少在前端显示来自带有流体的域模型的数据。但我不知道这种方法是否正确,或者是否有更好的方法?特别是设置持久层我不明白。
对于任何帮助,我非常感谢您提前所做的努力。
Is it possible fetching data from a cached xml file and then showing them on front end?
I was thinking doing it in a TYPO3 extension and with its domain model (and getter/setter) but without a database table. And then filling in data with SimpleXML just to "store" them in memory. At least display the data from domain model with fluid on front end. But I don't know is this approach right or is there a better way to do that? In particular setting up the persistence layer I don't understand.
For any help I thank you very much for your effort in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了一个“可接受”的解决方案。我的方法是:
1.从xml文件中获取所有项目
控制器:listAction、detailAction
存储库:findAll、findBySlugWithId
2.添加 slug 字段(控制器)
3.对项目进行排序(控制器)
4.在前端显示排序的项目(模板)
List.html:
Detail.html:
5.创建独特的漂亮网址
Routing/Aspect/XmlDetailMapper.php:
I found an "acceptable" solution. My approach for that was:
1. Get all items from xml file
Controller: listAction, detailAction
Repository: findAll, findBySlugWithId
2. Add a slug field (controller)
3. Sort the items (controller)
4. Display sorted items on the front end (templates)
List.html:
Detail.html:
5. Create unique pretty url
Routing/Aspect/XmlDetailMapper.php: